mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
sb/config: Escape double quotes on Windows for shell macros
Closes #3792
This commit is contained in:
parent
05f469b850
commit
d8b2719ae6
@ -421,14 +421,17 @@ class file:
|
|||||||
|
|
||||||
def _shell(self, line):
|
def _shell(self, line):
|
||||||
#
|
#
|
||||||
# Parse the line and handle nesting '()' pairs.
|
# Parse the line and handle nesting '()' pairs. If on Windows
|
||||||
|
# handle embedded '"' (double quotes) as the command is run as
|
||||||
|
# a double quoted string.
|
||||||
#
|
#
|
||||||
def _exec(shell_macro):
|
def _exec(shell_macro):
|
||||||
output = ''
|
output = ''
|
||||||
if len(shell_macro) > 3:
|
if len(shell_macro) > 3:
|
||||||
e = execute.capture_execution()
|
e = execute.capture_execution()
|
||||||
if options.host_windows:
|
if options.host_windows:
|
||||||
cmd = '%s -c "%s"' % (self.macros.expand('%{__sh}'), shell_macro[2:-1])
|
shell_cmd = ''.join([c if c != '"' else '\\' + c for c in shell_macro[2:-1]])
|
||||||
|
cmd = '%s -c "%s"' % (self.macros.expand('%{__sh}'), shell_cmd)
|
||||||
else:
|
else:
|
||||||
cmd = shell_macro[2:-1]
|
cmd = shell_macro[2:-1]
|
||||||
exit_code, proc, output = e.shell(cmd)
|
exit_code, proc, output = e.shell(cmd)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user