[lvm-windres] Try to match GNU windres regarding handling of unescaped quotes
Some background context: GNU windres invokes the preprocessor in a subprocess. Some windres options are passed through to the preproocessor, e.g. -D options for predefining defines. When GNU windres passes these options onwards, it takes the options in exact the form they are received (in argv or similar) and assembles them into a single preprocessor command string which gets interpreted by a shell (IIRC via the popen() function, or similar). When LLVM invokes subprocesses, it does so via APIs that take properly split argument vectors, to avoid needing to worry about shell quoting/escaping/unescaping. But in the case of LLVM windres, we have to emulate the effect of the shell parsing done by popen(). Most of the relevant cases are already taken care of here, but this patch fixes an uncommon case encountered in https://github.com/llvm/llvm-project/issues/57334. (This case is uncommon since it doesn't do what one would want to; the quotes need to be escaped more to work as intended through the popen() shell). Differential Revision: https://reviews.llvm.org/D146848
Loading
Please sign in to comment