aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic/glob.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-07-28 20:47:08 +0000
committerUlrich Drepper <drepper@redhat.com>1998-07-28 20:47:08 +0000
commit1bc21e7a70eb9f1f69c179bb251e612c7aecd655 (patch)
tree9ed0ab62f6a85dcae93d8239923bdb4c049c9b36 /sysdeps/generic/glob.c
parente852e889444a8bf27f3e5075d064e9922b38e7e2 (diff)
downloadglibc-1bc21e7a70eb9f1f69c179bb251e612c7aecd655.tar
glibc-1bc21e7a70eb9f1f69c179bb251e612c7aecd655.tar.gz
glibc-1bc21e7a70eb9f1f69c179bb251e612c7aecd655.tar.bz2
glibc-1bc21e7a70eb9f1f69c179bb251e612c7aecd655.zip
Update.
* resolv/nss_dns/dns-host.c (getanswer_r): Lower the priority of warnings when DNSSEC related records are received. * resolv/gethnamaddr.c (getanswer): Likewise. Patch by Brian Wellington <bwelling@anomaly.munge.com>. * signal/signal.h: Add prototype for sysv_signal. * math/libm-test.c (tgamma_test): Remove redundant tests. * posix/glob.h: Add GLOB_TILDE_CHECK. * sysdeps/generic/glob.c: Implement GLOB_TILDE_CHECK. * posix/globtest.c: Add option T to enable GLOB_TILDE_CHECK. * posix/globtest.sh: Re-enable test with ~ and non-existing user name.
Diffstat (limited to 'sysdeps/generic/glob.c')
-rw-r--r--sysdeps/generic/glob.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sysdeps/generic/glob.c b/sysdeps/generic/glob.c
index c9744fc46f..f54c3b3d21 100644
--- a/sysdeps/generic/glob.c
+++ b/sysdeps/generic/glob.c
@@ -493,7 +493,7 @@ glob (pattern, flags, errfunc, pglob)
{
/* This can mean two things: a simple name or "~name". The later
case is nothing but a notation for a directory. */
- if ((flags & GLOB_TILDE) && pattern[0] == '~')
+ if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && pattern[0] == '~')
{
dirname = (char *) pattern;
dirlen = strlen (pattern);
@@ -553,7 +553,7 @@ glob (pattern, flags, errfunc, pglob)
oldcount = pglob->gl_pathc;
#ifndef VMS
- if ((flags & GLOB_TILDE) && dirname[0] == '~')
+ if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && dirname[0] == '~')
{
if (dirname[1] == '\0' || dirname[1] == '/')
{
@@ -608,7 +608,10 @@ glob (pattern, flags, errfunc, pglob)
}
}
if (home_dir == NULL || home_dir[0] == '\0')
- home_dir = (char *) "~"; /* No luck. */
+ if (flags & GLOB_TILDE_CHECK)
+ return GLOB_NOMATCH;
+ else
+ home_dir = (char *) "~"; /* No luck. */
# endif /* WINDOWS32 */
# endif
/* Now construct the full directory. */
@@ -685,6 +688,11 @@ glob (pattern, flags, errfunc, pglob)
# endif
dirname = newp;
}
+ else
+ if (flags & GLOB_TILDE_CHECK)
+ /* We have to regard it as an error if we cannot find the
+ home directory. */
+ return GLOB_NOMATCH;
}
# endif /* Not Amiga && not WINDOWS32. */
}