use of undef var
authorStas Bekman <stas@stason.org>
Mon, 17 Jun 2002 16:31:48 +0000 (00:31 +0800)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 17 Jun 2002 12:49:06 +0000 (12:49 +0000)
Message-ID: <3D0D9E74.7000908@stason.org>

(modified)

p4raw-id: //depot/perl@17269

lib/File/Basename.pm

index 37faa6d..b2ab469 100644 (file)
@@ -167,6 +167,10 @@ sub fileparse_set_fstype {
 
 sub fileparse {
   my($fullname,@suffices) = @_;
+  unless (defined $fullname) {
+      require Carp;
+      Carp::croak "fileparse(): need a valid pathname";
+  }
   my($fstype,$igncase) = ($Fileparse_fstype, $Fileparse_igncase);
   my($dirpath,$tail,$suffix,$basename);
   my($taint) = substr($fullname,0,0);  # Is $fullname tainted?