From 1bc21e7a70eb9f1f69c179bb251e612c7aecd655 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 28 Jul 1998 20:47:08 +0000 Subject: 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 . * 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. --- sysdeps/generic/glob.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'sysdeps') 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. */ } -- cgit 1.4.1