diff options
author | Ulrich Drepper <drepper@redhat.com> | 1997-04-04 15:29:09 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1997-04-04 15:29:09 +0000 |
commit | 0f884de1765c5b7d5394d03138a5a139c55f730e (patch) | |
tree | dbd0f9289577da68fb57e538f64a22e308acea4a /posix | |
parent | 2c218fa5d90ba09e6e86149258ad7abb921f9279 (diff) |
(next_brace_sub): Decrement depth counter when '}' is found.
Rename glob_pattern_p to __glob_pattern_p and
make glob_pattern_p a weak alias. This function is used in other
packages (e.g. bash).
Diffstat (limited to 'posix')
-rw-r--r-- | posix/glob.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/posix/glob.c b/posix/glob.c index 86a79b08a1..44e548493c 100644 --- a/posix/glob.c +++ b/posix/glob.c @@ -250,7 +250,6 @@ extern char *alloca (); #undef GLOB_PERIOD #include <glob.h> -static int glob_pattern_p __P ((const char *pattern, int quote)); static int glob_in_dir __P ((const char *pattern, const char *directory, int flags, int (*errfunc) __P ((const char *, int)), @@ -288,7 +287,7 @@ next_brace_sub (const char *begin) while (*cp != '\0' && (*cp != '}' || depth > 0)) { if (*cp == '}') - ++depth; + --depth; ++cp; } if (*cp == '\0') @@ -617,7 +616,7 @@ glob (pattern, flags, errfunc, pglob) } #endif /* Not VMS. */ - if (glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE))) + if (__glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE))) { /* The directory name contains metacharacters, so we have to glob for the directory, and then glob for @@ -844,8 +843,8 @@ prefix_array (dirname, array, n) /* Return nonzero if PATTERN contains any metacharacters. Metacharacters can be quoted with backslashes if QUOTE is nonzero. */ -static int -glob_pattern_p (pattern, quote) +int +__glob_pattern_p (pattern, quote) const char *pattern; int quote; { @@ -876,6 +875,9 @@ glob_pattern_p (pattern, quote) return 0; } +#ifdef _LIBC +weak_alias (__glob_pattern_p, glob_pattern_p) +#endif /* Like `glob', but PATTERN is a final pathname component, @@ -900,7 +902,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) struct globlink *names = NULL; size_t nfound = 0; - if (!glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE))) + if (!__glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE))) { stream = NULL; flags |= GLOB_NOCHECK; @@ -958,7 +960,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) } if (nfound == 0 && (flags & GLOB_NOMAGIC) && - ! glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE))) + ! __glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE))) flags |= GLOB_NOCHECK; if (nfound == 0 && (flags & GLOB_NOCHECK)) |