소스 검색

Hopefully fix Win32

Morten Brix Pedersen 25 년 전
부모
커밋
38b0ea64b3
1개의 변경된 파일10개의 추가작업 그리고 1개의 파일을 삭제
  1. 10 1
      pisg.pl

+ 10 - 1
pisg.pl

@@ -24,7 +24,16 @@ use Getopt::Long;
 sub main
 {
     my $script_dir = $0;
-    $script_dir =~ s/\/[^\/]*$//;
+
+    # If the script was executed as ./pisg.pl - then we just remove
+    # everything after the last slash, if it was executed as 'perl pisg.pl'
+    # we assume that we are executing in the current dir.
+    if ($script_dir =~ m/\/[^\/]*$/) {
+        $script_dir =~ s/\/[^\/]*$//;
+    } else {
+        $script_dir = ".";
+    }
+
     my $cfg = get_cmdline_options($script_dir);
     push(@INC, $cfg->{modules_dir});