]> andersk Git - openssh.git/blobdiff - fixpaths
20010115
[openssh.git] / fixpaths
index e6f47c713643599c158d866fc6001efed75038fb..edd9e486f17e119c0f18af96096da413c6cfb7c7 100755 (executable)
--- a/fixpaths
+++ b/fixpaths
@@ -22,7 +22,8 @@ while ($_=$ARGV[0], /^-/) {
       die ("$usage$0: error in command line arguments.\n");
     }
   } else {
-    die ("$usage$0: unknown option '-".$ARGV[0][1]."'\n");
+    @cmd = split(//, $ARGV[0]); $opt = $cmd[1];
+    die ("$usage$0: unknown option '-$opt'\n");
   }
 } # while parsing arguments
 
@@ -36,14 +37,13 @@ for $f (@ARGV) {
   $of = $2.".$ext"; 
 
   open(IN, "<$f")          || die ("$0: input file $f missing!\n");
-  if (open(OUT, ">$of")) {
-    while (<IN>) {
-      for $s (keys(%def)) {
-       s#$s#$def{$s}#;
-      } # for $s
-      print OUT;
-    } # while <IN>
-  } # if (outfile open)
+  open(OUT, ">$of")        || die ("$0: cannot create output file $of: $!\n");
+  while (<IN>) {
+    for $s (keys(%def)) {
+      s#$s#$def{$s}#;
+    } # for $s
+    print OUT;
+  } # while <IN>
 } # for $f
 
 exit 0;
This page took 0.034264 seconds and 4 git commands to generate.