diff options
-rw-r--r-- | win32/fnmatch.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/win32/fnmatch.c b/win32/fnmatch.c index 7d8fde6a2..77b54c5f5 100644 --- a/win32/fnmatch.c +++ b/win32/fnmatch.c | |||
@@ -423,6 +423,7 @@ internal_fnmatch (const char *pattern, const char *string, | |||
423 | goto matched; | 423 | goto matched; |
424 | break; | 424 | break; |
425 | } | 425 | } |
426 | c = *p++; | ||
426 | # endif | 427 | # endif |
427 | } | 428 | } |
428 | else if (c == '\0') | 429 | else if (c == '\0') |
@@ -463,13 +464,14 @@ internal_fnmatch (const char *pattern, const char *string, | |||
463 | 464 | ||
464 | matched: | 465 | matched: |
465 | /* Skip the rest of the [...] that already matched. */ | 466 | /* Skip the rest of the [...] that already matched. */ |
466 | while (c != ']') | 467 | do |
467 | { | 468 | { |
469 | c = *p++; | ||
470 | |||
468 | if (c == '\0') | 471 | if (c == '\0') |
469 | /* [... (unterminated) loses. */ | 472 | /* [... (unterminated) loses. */ |
470 | return FNM_NOMATCH; | 473 | return FNM_NOMATCH; |
471 | 474 | ||
472 | c = *p++; | ||
473 | if (!(flags & FNM_NOESCAPE) && c == '\\') | 475 | if (!(flags & FNM_NOESCAPE) && c == '\\') |
474 | { | 476 | { |
475 | if (*p == '\0') | 477 | if (*p == '\0') |
@@ -487,6 +489,7 @@ internal_fnmatch (const char *pattern, const char *string, | |||
487 | c = *p; | 489 | c = *p; |
488 | } | 490 | } |
489 | } | 491 | } |
492 | while (c != ']'); | ||
490 | if (not) | 493 | if (not) |
491 | return FNM_NOMATCH; | 494 | return FNM_NOMATCH; |
492 | } | 495 | } |