diff options
author | John Ankarstrom <john@ankarstrom.se> | 2021-07-08 21:54:44 +0200 |
---|---|---|
committer | John Ankarstrom <john@ankarstrom.se> | 2021-07-08 21:54:44 +0200 |
commit | 35915d4d4bbd68d9bed3a3591a872625af9a3842 (patch) | |
tree | 5f726d14752b3e1f24a80bc73e84fed4a780f04d | |
parent | 0f7e76134a9676111e59d80514fd8cec7292bba0 (diff) | |
download | patches-35915d4d4bbd68d9bed3a3591a872625af9a3842.tar.gz |
conv: Fix disappearing backslashes, backup saving
-rwxr-xr-x | conv | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -27,7 +27,7 @@ IFS=' s/^--- .*/&/; ' } | -while read line; do +while read -r line; do case "$line" in diff*) ;; index*) ;; @@ -70,7 +70,8 @@ if [ x"$1" = x"-i" ]; then # write patch if it doesn't already exist if [ -e $dir/$name ]; then f=`mktemp -t ${0##*/}` || exit 1 - echo error: $dir/$name already exists; saving to $f 1>&2 + printf '%s\n' "$patch" > $f + echo "error: $dir/$name already exists; saving to $f" 1>&2 exit 1 else printf '%s\n' "$patch" > $dir/$name |