Test script for DynaLoader
[p5sagit/p5-mst-13.2.git] / win32 / bin / search.pl
index b63f735..2ceffa7 100644 (file)
@@ -47,7 +47,12 @@ $version = "950918.5";
 $stripped=0;
 
 &init;
-$rc_file = join('/', $ENV{'HOME'}, ".search");
+if (exists $ENV{'HOME'}) {
+    $rc_file = join('/', $ENV{'HOME'}, ".search");
+}
+else {
+    $rc_file = "";
+}
 
 &check_args;
 
@@ -71,6 +76,7 @@ sub init
 {
   ## initialize variables that might be reset by command-line args
   $DOREP=0;            ## set true by -dorep (redo multi-hardlink files)
+  $DOREP=1 if $^O eq 'MSWin32';
   $DO_SORT=0;           ## set by -sort (sort files in a dir before checking)
   $FIND_ONLY=0;         ## set by -find (don't search files)
   $LIST_ONLY=0;                ## set true by -l (list filenames only)
@@ -620,7 +626,7 @@ sub read_rc
     local($line_num, $ln, $tag) = 0;
     local($use_default, @default) = 0;
 
-    { package magic; $\17 = 0; } ## turn off warnings for when we run EXPR's
+    { package magic; $^W= 0; } ## turn off warnings for when we run EXPR's
 
     unless (open(RC, "$file")) {
        $use_default=1;
@@ -628,8 +634,8 @@ sub read_rc
        ## no RC file -- use this default.
        @default = split(/\n/,<<'--------INLINE_LITERAL_TEXT');
             magic: 32 : $H =~ m/[\x00-\x06\x10-\x1a\x1c-\x1f\x80\xff]{2}/
-           option: -skip '.a .COM .elc .EXE .gz .o .pbm .xbm .dvi'
-           option: -iskip '.tarz .zip .z .lzh .jpg .jpeg .gif .uu'
+           option: -skip '.a .elc .gz .o .pbm .xbm .dvi'
+           option: -iskip '.com .exe .lib .pdb .tarz .zip .z .lzh .jpg .jpeg .gif .uu'
            <!~> option: -skip '~ #'
 --------INLINE_LITERAL_TEXT
     }
@@ -867,7 +873,7 @@ sub dodir
     }
 
     ## skip things that are empty
-    unless (-s _) {
+    unless (-s _ || -d _) {
        warn qq/skip (empty): $file\n/ if $WHY;
        next;
     }
@@ -894,7 +900,7 @@ sub dodir
        }
 
        ## _never_ redo a directory
-       if (defined $dir_done{$id}) {
+       if (defined $dir_done{$id} and $^O ne 'MSWin32') {
            warn qq/skip (did as "$dir_done{$id}"): $file\n/ if $WHY;
            next;
        }