Bug 12722 – executeShell incorrectly handling escaped quotes

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2014-05-09T15:43:11Z
Last change time
2019-12-06T13:16:10Z
Assigned to
No Owner
Creator
Josh

Comments

Comment #0 by moonburntm — 2014-05-09T15:43:11Z
DMD 2.065 executeShell("echo \"quoted statement\"").output returns "quoted statement executeShell("echo \"quoted statement\"\"").output returns "quoted statement"
Comment #1 by andrej.mitrovich — 2014-05-09T15:46:04Z
Not sure if an actual bug, but in any case there's escapeShellCommand for this. It should probably be mentioned in the executeShell docs (escapeShellFileName docs reference executeShell, but not the other way around).
Comment #2 by moonburntm — 2014-05-10T00:58:41Z
It seems that executeShell("echo \"quoted statement 1\" \"quoted statement 1\" \"quoted statement 3\"").output returns "quoted statement 1" "quoted statement 1" "quoted statement 3 whereas executeShell("echo \"quoted statement 1\" \"quoted statement 1\" \"quoted statement 3\"\"").output returns "quoted statement 1" "quoted statement 1" "quoted statement 3" So it's only the last one that doesn't escape properly.
Comment #3 by bugzilla — 2019-12-06T13:16:10Z
seems to be fixed