diff options
Diffstat (limited to 'wrappers/shadow-cc.sh')
-rwxr-xr-x | wrappers/shadow-cc.sh | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/wrappers/shadow-cc.sh b/wrappers/shadow-cc.sh index 185a3bd..24f6a9a 100755 --- a/wrappers/shadow-cc.sh +++ b/wrappers/shadow-cc.sh @@ -232,15 +232,21 @@ generate_shadow_rsp () if [ "$(stat --format=%s "$orig_rsp")" = 0 ]; then touch "$shadow_rsp" else - local delim="" - while read -r orig_file; do + local quote delim="" + while read -d '' -r orig_file; do + # unquote orig + case "$orig_file" in + \'*\') quote="'"; orig_file=${orig_file:1:-1} ;; + *) quote="" ;; + esac shadow_file=$(print_shadow_path "$orig_file") if ! [ -e "$shadow_file" ]; then shadow_file="$orig_file" fi - echo -ne "$delim$shadow_file" >> "$shadow_rsp" + # quote shadow + echo -ne "$delim$quote$shadow_file$quote" >> "$shadow_rsp" delim=" " - done < <({ cat "$orig_rsp"; echo; } | tr ' ' '\n') + done < <({ cat "$orig_rsp"; echo; } | xargs printf '%s\0') fi echo "$shadow_rsp" |