summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/patchfns.in26
1 files changed, 12 insertions, 14 deletions
diff --git a/scripts/patchfns.in b/scripts/patchfns.in
index 6caf2ca..b46b362 100644
--- a/scripts/patchfns.in
+++ b/scripts/patchfns.in
@@ -610,23 +610,21 @@ cat_file()
done
}
-cat_to_file()
+cat_to_new_file()
{
local filename="$1"
- if [ -z "$filename" ]
- then
- cat
- else
- case "$filename" in
- *.gz|*.tgz)
- gzip -c > "$filename" ;;
- *.bz2)
- bzip2 -c > "$filename" ;;
- *)
- cat > "$filename" ;;
- esac
- fi
+ [ -e "$filename" ] && rm -f "$filename"
+
+ case "$filename" in
+ *.gz)
+ gzip -c ;;
+ *.bz2)
+ bzip2 -c ;;
+ *)
+ cat ;;
+ esac \
+ > "$filename"
}
patch_description()