diff options
author | peter <peter@FreeBSD.org> | 1995-12-03 14:17:06 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1995-12-03 14:17:06 +0000 |
commit | 9ca0b4c9b412d7dda977978385bde9c882ff3f80 (patch) | |
tree | 117f9ffd4a531ea36c0d4a1d741bc1e14cb9aa98 /gnu/usr.bin/cvs/lib/fnmatch.c | |
parent | 35ee95831939f06cb374e771e2a51cf938bff1fa (diff) | |
download | FreeBSD-src-9ca0b4c9b412d7dda977978385bde9c882ff3f80.zip FreeBSD-src-9ca0b4c9b412d7dda977978385bde9c882ff3f80.tar.gz |
Restore white spaces to original cvs-1.4Alpha2 state so that we can
deal with the cvs-1.6 (and beyond) imports more cleanly and safely.
Diffstat (limited to 'gnu/usr.bin/cvs/lib/fnmatch.c')
-rw-r--r-- | gnu/usr.bin/cvs/lib/fnmatch.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/gnu/usr.bin/cvs/lib/fnmatch.c b/gnu/usr.bin/cvs/lib/fnmatch.c index 34a0f89..2a05430 100644 --- a/gnu/usr.bin/cvs/lib/fnmatch.c +++ b/gnu/usr.bin/cvs/lib/fnmatch.c @@ -66,27 +66,27 @@ fnmatch (pattern, string, flags) (n == string || ((flags & FNM_PATHNAME) && n[-1] == '/'))) return FNM_NOMATCH; break; - + case '\\': if (!(flags & FNM_NOESCAPE)) c = *p++; if (*n != c) return FNM_NOMATCH; break; - + case '*': if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_PATHNAME) && n[-1] == '/'))) return FNM_NOMATCH; - + for (c = *p++; c == '?' || c == '*'; c = *p++, ++n) if (((flags & FNM_PATHNAME) && *n == '/') || (c == '?' && *n == '\0')) return FNM_NOMATCH; - + if (c == '\0') return 0; - + { char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; for (--p; *n != '\0'; ++n) @@ -95,41 +95,41 @@ fnmatch (pattern, string, flags) return 0; return FNM_NOMATCH; } - + case '[': { /* Nonzero if the sense of the character class is inverted. */ register int not; - + if (*n == '\0') return FNM_NOMATCH; - + if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_PATHNAME) && n[-1] == '/'))) return FNM_NOMATCH; - + not = (*p == '!' || *p == '^'); if (not) ++p; - + c = *p++; for (;;) { register char cstart = c, cend = c; - + if (!(flags & FNM_NOESCAPE) && c == '\\') cstart = cend = *p++; - + if (c == '\0') /* [ (unterminated) loses. */ return FNM_NOMATCH; - + c = *p++; - + if ((flags & FNM_PATHNAME) && c == '/') /* [/] can never match. */ return FNM_NOMATCH; - + if (c == '-' && *p != ']') { cend = *p++; @@ -139,17 +139,17 @@ fnmatch (pattern, string, flags) return FNM_NOMATCH; c = *p++; } - + if (*n >= cstart && *n <= cend) goto matched; - + if (c == ']') break; } if (!not) return FNM_NOMATCH; break; - + matched:; /* Skip the rest of the [...] that already matched. */ while (c != ']') @@ -157,7 +157,7 @@ fnmatch (pattern, string, flags) if (c == '\0') /* [... (unterminated) loses. */ return FNM_NOMATCH; - + c = *p++; if (!(flags & FNM_NOESCAPE) && c == '\\') /* 1003.2d11 is unclear if this is right. %%% */ @@ -167,12 +167,12 @@ fnmatch (pattern, string, flags) return FNM_NOMATCH; } break; - + default: if (c != *n) return FNM_NOMATCH; } - + ++n; } |