Explorar el Código

Fix parameter matching

The original regexes would match inside other arguments;

Eg.

    mkexec foo-foo

would match as if -f was presented.
Alois Mahdal hace 8 años
padre
commit
d7af9a2566
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2
    2
      bin/mkexec

+ 2
- 2
bin/mkexec Ver fichero

@@ -22,9 +22,9 @@ my $edit = $DEFAULT_EDIT;
22 22
 my $name; my $type; my $purpose;
23 23
 
24 24
 foreach (@ARGV) {
25
-    if (m/-f|--force/) {
25
+    if (m/\b-f\b|\b--force\b/) {
26 26
         $force++;
27
-    } elsif (m/-e|--edit/) {
27
+    } elsif (m/\b-e\b|\b--edit\b/) {
28 28
         $edit++;
29 29
     } elsif (defined $type) {
30 30
         $purpose = $_;