aboutsummaryrefslogtreecommitdiff
path: root/conv
diff options
context:
space:
mode:
authorJohn Ankarstrom <john@ankarstrom.se>2021-07-08 21:54:44 +0200
committerJohn Ankarstrom <john@ankarstrom.se>2021-07-08 21:54:44 +0200
commit35915d4d4bbd68d9bed3a3591a872625af9a3842 (patch)
tree5f726d14752b3e1f24a80bc73e84fed4a780f04d /conv
parent0f7e76134a9676111e59d80514fd8cec7292bba0 (diff)
downloadpatches-35915d4d4bbd68d9bed3a3591a872625af9a3842.tar.gz
conv: Fix disappearing backslashes, backup saving
Diffstat (limited to 'conv')
-rwxr-xr-xconv5
1 files changed, 3 insertions, 2 deletions
diff --git a/conv b/conv
index c7b6ffb..06f5079 100755
--- a/conv
+++ b/conv
@@ -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