Open
Conversation
* when calling external programs, pass arguments individually instead of quoting them together. * remove FileCleaner.pm since it's no longer needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Special characters in file name
Files with special characters in their names should be handled correctly now.
Ninka has a module named
FileCleaner.pmto clean up input file names with special characters such as',$,;and(space). This file name is passed as an argument to external programs (eithercommentsorhead) usingopen3().However, the command for the external call was constructed by quoting command name and arguments together, for example
"head -$count_lines $input_file". In such way, the program will not execute correctly if$input_filecontains special characters which are not cleaned up in the previous step (such as<and().What I did is split the command name and arguments into an array and pass it to
open3(). Now the file names will be handled correctly and we don't needFileCleaner.pmany more, thus removed.Another minor improvement
Die the program if the input file does not exist, to suppress the error message: