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' bug: -exec causes chdir error #7181
Comments
From @jdheddenThe code generated by 'find2perl' when the '-exec' directive is used Here is an example of the generated code: <<< EXAMPLE STARTS >>> > find2perl.buggy . -name '*.pl' -exec grep -H BUGUS '{}' ';' use strict; # Set the variable $File::Find::dont_use_nlink if you're using # for the convenience of &wanted calls, including -eval sub wanted; # Traverse desired filesystems sub wanted { use Cwd (); sub doexec ($@) { <<< EXAMPLE ENDS >>> Note in the above that the lines: use Cwd (); occur after: File::Find::find({wanted => \&wanted}, '.'); As a result $cwd never gets set, and causes errors when the doexec() <<< EXAMPLE STARTS >>> > find2perl.buggy . -name '*.pl' -exec grep -H BUGUS '{}' ';' | <<< EXAMPLE ENDS >>> I have verified that this bug is present in the following Perl I have a fix for this bug. The following is a diff of 'find2perl' as <<< DIFF STARTS >>> 259a260,267 <<< DIFF ENDS >>> This fix will work with all the versions of 'find2perl' in the <<< FIRST CODE SECTION STARTS >>> $declaresubs END ### The following block needs to be added ### END if (exists $init{ls}) { <<< FIRST CODE SECTION ENDS >>> <<< SECOND CODE SECTION STARTS >>> if (exists $init{doexec}) { ### The following two lines need to be removed ### sub doexec ($@) { <<< SECOND CODE SECTION ENDS >>> Thank you, |
From @iabynOn Thu, Mar 18, 2004 at 08:25:50PM -0000, jdhedden@1979.usna.com (via RT) wrote:
Thanks, your patch has been applied to the development veersion of Perl as NB: in case you submit any future patches, it is easier for us if you Dave. -- |
The RT System itself - Status changed from 'new' to 'open' |
@iabyn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#27748 (status was 'resolved')
Searchable as RT27748$
The text was updated successfully, but these errors were encountered: