Skip to content

Commit

Permalink
all: Properly handle an include file name ending with '\'
Browse files Browse the repository at this point in the history
Signed-off-by: Quentin Armitage <[email protected]>
  • Loading branch information
pqarmitage committed Jul 9, 2024
1 parent 223d097 commit 0b894f9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1648,9 +1648,10 @@ have_brace(const char *conf_file)
return false;

do {
if (*p == '\\')
p++;
else if (*p == '{')
if (*p == '\\') { // Skip a '\' and following character
if (!*++p) // Ensure '\' not last character
return false;
} else if (*p == '{')
return true;
} while (*++p);

Expand Down

0 comments on commit 0b894f9

Please sign in to comment.