-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix #13968: Addon execution fails for some paths with spaces on Windows #7632
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
base: main
Are you sure you want to change the base?
Conversation
205ad6f
to
8ecd18f
Compare
ec = 1 if os.name == 'nt' else 127 | ||
|
||
# Make sure the full command is used | ||
assert 'The system cannot find the path specified. [internalError]' in stderr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the fix, the error is similar to the one in the ticket, i.e. the part before the whitespace is interpreted as a command, and the rest of the path it's argument(s).
|
||
#ifdef _WIN32 | ||
cmd = "\"" + cmd + "\""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spontanously this looks wrong to me. If cmd is:
"C:\Program Files\Cppcheck Premium\premiumaddon.exe" --cli foo.c.dump
then here it is changed to:
""C:\Program Files\Cppcheck Premium\premiumaddon.exe" --cli foo.c.dump"
so if the initial ""
are removed then that is:
C:\Program Files\Cppcheck Premium\premiumaddon.exe" --cli foo.c.dump"
Is this intended behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what situation would the ""
be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm.. I believe that "" means nothing in the command processor?
I assume that a command ""C:\Program Files\Cppcheck Premium\premiumaddon.exe" --cli foo.c.dump"
would fail if I execute it in a windows command terminal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Windows command line seems to parse quotations differently: https://stackoverflow.com/a/6378038
No description provided.