From 35915d4d4bbd68d9bed3a3591a872625af9a3842 Mon Sep 17 00:00:00 2001 From: John Ankarstrom Date: Thu, 8 Jul 2021 21:54:44 +0200 Subject: conv: Fix disappearing backslashes, backup saving --- conv | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'conv') 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 -- cgit v1.2.3