diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2004-08-02 18:21:05 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2004-08-02 18:21:05 +0000 |
commit | b4b2eed874e0d47f56adec363c616ba360f7e5a2 (patch) | |
tree | 3aea746b60449948e7db2d244fc11241a2064eb1 | |
parent | 272dfbf17388faf950137a1b0c07a4997a479162 (diff) | |
download | coreutils-b4b2eed874e0d47f56adec363c616ba360f7e5a2.tar.xz |
(EXT): Use size_t for sizes, not ptrdiff_t, so that we don't have
to worry about wraparound.
-rw-r--r-- | lib/fnmatch_loop.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/fnmatch_loop.c b/lib/fnmatch_loop.c index 6d627b233..7cea5a76e 100644 --- a/lib/fnmatch_loop.c +++ b/lib/fnmatch_loop.c @@ -999,7 +999,7 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end, bool no_leading_period, int flags) { const CHAR *startp; - ptrdiff_t level; + size_t level; struct patternlist { struct patternlist *next; @@ -1013,7 +1013,7 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end, /* Parse the pattern. Store the individual parts in the list. */ level = 0; - for (startp = p = pattern + 1; level >= 0; ++p) + for (startp = p = pattern + 1; ; ++p) if (*p == L('\0')) /* This is an invalid pattern. */ return -1; @@ -1066,6 +1066,7 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end, *lastp = newp; \ lastp = &newp->next NEW_PATTERN; + break; } } else if (*p == L('|')) |