This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #113054] find2perl mistranslates fileglob ? to regex .?
authorTony Cook <tony@develop-help.com>
Wed, 14 Aug 2013 02:17:31 +0000 (12:17 +1000)
committerTony Cook <tony@develop-help.com>
Wed, 21 Aug 2013 05:13:42 +0000 (15:13 +1000)
fix and un-TODO the test

t/x2p/find2perl.t
x2p/find2perl.PL

index b3066ab..e2444b5 100644 (file)
@@ -149,7 +149,6 @@ my @testcases =
         {
             name => "[perl #113054] mapping of ?",
             args => [ "-name", "a?c" ],
-            TODO => "perl #113054",
         },
     );
 
index e9275d0..d68c036 100644 (file)
@@ -681,7 +681,8 @@ sub tab () {
 sub fileglob_to_re ($) {
     my $x = shift;
     $x =~ s#([./^\$()+])#\\$1#g;
-    $x =~ s#([?*])#.$1#g;
+    $x =~ s#\*#.*#g;
+    $x =~ s#\?#.#g;
     "^$x\\z";
 }