summaryrefslogtreecommitdiff
path: root/ext/File
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-12-14 20:26:51 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-14 20:26:51 +0000
commit7bb5bfba443be93b884381f142c125de71fe95d1 (patch)
treef49c9403cd1cc334397f844bb010b840b9f6f833 /ext/File
parentaa7b0f08eeb71201c1ede505b4a21af419108872 (diff)
downloadperl-7bb5bfba443be93b884381f142c125de71fe95d1.tar.gz
User may not have a valid home directory even if
getpwuid() succedds. p4raw-id: //depot/perl@13690
Diffstat (limited to 'ext/File')
-rwxr-xr-xext/File/Glob/t/basic.t8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/File/Glob/t/basic.t b/ext/File/Glob/t/basic.t
index c6fc21739b..2eb891b348 100755
--- a/ext/File/Glob/t/basic.t
+++ b/ext/File/Glob/t/basic.t
@@ -49,9 +49,11 @@ if ($^O ne 'MSWin32' && $^O ne 'NetWare' && $^O ne 'VMS' && $^O ne 'os2') {
($name, $home) = (getpwuid($>))[0,7];
1;
} and do {
- @a = bsd_glob("~$name", GLOB_TILDE);
- if (defined $home && (scalar(@a) != 1 || $a[0] ne $home || GLOB_ERROR)) {
- print "not ";
+ if (defined $home && defined $name && -d $home) {
+ @a = bsd_glob("~$name", GLOB_TILDE);
+ if ((scalar(@a) != 1 || $a[0] ne $home || GLOB_ERROR)) {
+ print "not ";
+ }
}
};
}