aboutsummaryrefslogtreecommitdiff
path: root/bin/savepatch
diff options
context:
space:
mode:
Diffstat (limited to 'bin/savepatch')
-rwxr-xr-xbin/savepatch6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/savepatch b/bin/savepatch
index 2a6cec9..963fbab 100755
--- a/bin/savepatch
+++ b/bin/savepatch
@@ -11,8 +11,10 @@ dir=$(whereispatch -i)
mkdir -p "$dir"
+read -r first
if [ -e "$dir/$1" ]; then
- printf "%s: %s already exists; overwrite? " "${0##*/}" "$dir/$1" 1>&2
+ printf "%s: %s already exists; overwrite? " \
+ "${0##*/}" "${dir#/home/*/patches/}/$1" 1>&2
read ans </dev/tty
case $ans in
y*) ;;
@@ -20,5 +22,5 @@ if [ -e "$dir/$1" ]; then
esac
fi
-cat > "$dir/$1"
+{ echo "$first"; cat; } > "$dir/$1"
echo "$dir/$1"