-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Shell quote #1772
Shell quote #1772
Conversation
Yeah |
I think I should drop the first patch as instead of fixing things it makes them fail. |
910d316
to
0a87d1d
Compare
It looks like shellquote() doesn't work the same way on MacOS and on Linux :-( |
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
The problem comes from sed adding a newline character on Mac OS. Let's try with:
as encapsulating everything inside a printf should remove the extra newline. |
The Travis test failure is not related, so it looks like encapsulating in a printf is working. |
@ion1 By the way the Git implementation quotes both https://github.com/git/git/blob/master/quote.c#L23 so maybe we will have to do something for |
Huh, interesting. I have never seen a shell which needs special handling for https://gist.github.com/ion1/7405148
|
It is because of csh-based shells according to the following commit: |
This should substitute sed -e 's/\([!'\'']\)/'\''\\\1'\''/g' |
Since you’re working around the newline issue with a wrapping printf, I wonder if you could just do |
Let's first add a comment to explain why the wrapper printf() is needed. Then let's replace the last instructions by quotes inside the wrapper printf() first argument, and let's also put there the eventual space so that we can remove the printf on the above line. License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Yeah, it is a good idea I think to do |
The CI test failure is not related. |
thanks @chriscool |
Fix shellquote() implementation and add tests as discussed in PR #1757.
Thanks @ion1!