Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Correctly execute the command passed to cc_args.py #131

Merged
merged 1 commit into from

3 participants

@ianliu

The original command line passed to cc_args.py program was losing shell
escaping sequences. For instance, if one would execute the following
command

$ cc_args.py gcc -DVERSION=\"0.1.0\" ...

the command would first be unescaped by the shell and then cc_args.py
would execute

$ gcc -DVERSION="0.1.0" ...

which is incorrect. With this patch, cc_args.py uses Python's subprocess
module, which executes correctly.

@ianliu ianliu Correctly execute the command passed to cc_args.py
The original command line passed to cc_args.py program was losing shell
escaping sequences. For instance, if one would execute the following
command

 $ cc_args.py gcc -DVERSION=\"0.1.0\" ...

the command would first be unescaped by the shell and then cc_args.py
would execute

 $ gcc -DVERSION="0.1.0" ...

which is incorrect.
0b6b4c0
@xaizek xaizek merged commit dae9c12 into from
@xaizek
Collaborator

Thanks!

@jonpasski

Ah, my bad. I'm using Vundle and it's pulling from https://github.com/vim-scripts/clang-complete, not here. Changing remote origin. Sorry about the dup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 18, 2012
  1. @ianliu

    Correctly execute the command passed to cc_args.py

    ianliu authored
    The original command line passed to cc_args.py program was losing shell
    escaping sequences. For instance, if one would execute the following
    command
    
     $ cc_args.py gcc -DVERSION=\"0.1.0\" ...
    
    the command would first be unescaped by the shell and then cc_args.py
    would execute
    
     $ gcc -DVERSION="0.1.0" ...
    
    which is incorrect.
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 3 deletions.
  1. +6 −3 bin/cc_args.py
View
9 bin/cc_args.py
@@ -76,9 +76,12 @@ def mergeLists(base, new):
writeConfiguration(map(lambda x: x + "\n", result))
-status = os.system(" ".join(sys.argv[1:]))
-if not os.WIFEXITED(status):
+import subprocess
+proc = subprocess.Popen(sys.argv[1:])
+ret = proc.wait()
+
+if ret is None:
sys.exit(1)
-sys.exit(os.WEXITSTATUS(status))
+sys.exit(ret)
# vim: set ts=2 sts=2 sw=2 expandtab :
Something went wrong with that request. Please try again.