X-Git-Url: https://git.8kb.co.uk/?p=dataflex%2Fdf32func;a=blobdiff_plain;f=src%2Fc%2Fgnuregex.c;fp=src%2Fc%2Fgnuregex.c;h=f5cce37a72929641ce34a68d25ee6c5211f66542;hp=f0f2dea668b76d7960c85bef8c81b931eb99de56;hb=67d1bf8be782956ec104758872a300e934b80895;hpb=21b727fd491be6f9953f1675b18385296cab0955 diff --git a/src/c/gnuregex.c b/src/c/gnuregex.c index f0f2dea..f5cce37 100644 --- a/src/c/gnuregex.c +++ b/src/c/gnuregex.c @@ -31,7 +31,7 @@ static char * quote_output(char *str) { /* Check for characters that need quoting */ for (ptr = str; *ptr; ptr++) { char ch = *ptr; - if (ch == '\"' || ch =='\\' || ch == '\{' || ch == ',') { + if (ch == '"' || ch =='\\' || ch == '{' || ch == ',') { do_quote = 1; break; } @@ -118,11 +118,11 @@ static int compile_regex(regex_t *re, const char *pattern, const char *flags, in status = regcomp(re, pattern, cflags); if (status != REG_NOERROR) { - if (errors == 1) { - char error_message[MAX_ERROR_MSG]; - regerror (status, re, error_message, MAX_ERROR_MSG); - fprintf (stderr, "Regex error compiling '%s': %s\n", pattern, error_message); - } + if (errors == 1) { + char error_message[MAX_ERROR_MSG]; + regerror (status, re, error_message, MAX_ERROR_MSG); + fprintf (stderr, "Regex error compiling '%s': %s\n", pattern, error_message); + } } return status; } @@ -300,7 +300,7 @@ int regexp_match(const char *str, const char *pattern, const char *flags, int er if (!result) /* match */ return 1; else /* no match */ - return 0; + return 0; } else /* error condition, but still: no match */ return 0;