New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
find2perl mistranslates fileglob ? to regex .? #12130
Comments
From chall0@gmail.comCreated by chall0@gmail.comWhen find2perl attempts to convert fileglob patterns to regular expressions, it fails to do the right thing for the ? character. The resulting regex uses .? instead of just . and thus incorrectly matches an empty substring. Test case: $ touch ab axb ayb The following patch seems to fix it for me: Inline Patch--- find2perl.orig 2012-03-06 19:36:39.000000000 +0000
+++ find2perl 2012-05-23 12:21:04.976166972 +0100
@@ -648,7 +648,8 @@
sub fileglob_to_re ($) {
my $x = shift;
$x =~ s#([./^\$()+])#\\$1#g;
- $x =~ s#([?*])#.$1#g;
+ $x =~ s#\*#.*#g;
+ $x =~ s#\?#.#g;
"^$x\\z";
} Perl Info
|
From @jkeenanOn Wed May 23 04:23:48 2012, chall0@gmail.com wrote:
Reviewing this RT, I had occasion to ack blead for 'find2perl'. I Is that correct? If so, would we be able to write tests for 'find2perl' Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @tonycozOn Wed May 23 17:47:08 2012, jkeenan wrote:
I've added (currently in smoke-me/tonyc/find2perl) some basic tests for Currently it compares the results against find(1) and restricts the If it smokes ok I'll push it to blead. Tony |
From @tonycozOn Wed May 23 17:47:08 2012, jkeenan wrote:
I've added tests in bdbb33c, structured I fixed the ? mis-mapping in bea9788. Tony |
@tonycoz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#113054 (status was 'resolved')
Searchable as RT113054$
The text was updated successfully, but these errors were encountered: