From feeea88a582a59e70c7d7c227c222a052133a0ff Mon Sep 17 00:00:00 2001 From: John Johansen Date: Thu, 15 Mar 2012 12:10:35 -0700 Subject: [PATCH] Fix the case where no flags match Currently the backend doesn't like it (blows up) when the a vector entry is empty. For the case where no flags match build_mnt_flags generates an alternation of an impossible entry and nothing (impossible|) This provides the effect of a null entry without having an empty vector entry. Unfortunately the impossible entry is not correct. Note: how this is done needs to be changed and fixed in the next release this is just a minimal patch to get it working for 2.8 Signed-off-by: John Johansen Acked-By: Steve Beattie --- parser/parser_regex.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parser/parser_regex.c b/parser/parser_regex.c index 7a1218c55..0e6e4490a 100644 --- a/parser/parser_regex.c +++ b/parser/parser_regex.c @@ -712,6 +712,8 @@ static int build_mnt_flags(char *buffer, int size, unsigned int flags, p += len; size -= len; } + + /* this needs to go once the backend is updated. */ if (buffer == p) { /* match nothing - use impossible 254 as regex parser doesn't * like the empty string @@ -719,7 +721,7 @@ static int build_mnt_flags(char *buffer, int size, unsigned int flags, if (size < 9) return FALSE; - strcpy(p, "(\\0xfe|)"); + strcpy(p, "(\\xfe|)"); } return TRUE;