Fix parsing arguments with spacing #74
Closed
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.
Fixes issue #11.
Uses different approach from #56. When going through each file, if the file contains a space (meaning multiple arguments) and we're not on Windows, then it will attempt to use the following method to get the correct arguments.
It reads all lines from proc//cmdline. This contains the command used where each argument is separated by a NUL (0x00) character rather than spaces. So this means any spaces that are within the arguments themselves will be ignored.
Some particular notes:
Interested in input, but I believe this method will be faster than #56 because in one file read it knows what the correct command arguments are rather than trying all combinations.
Credit goes to @moos because I basically used his test from PR and modified to get it working. Quite brilliant actually!