summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorremko <remko@FreeBSD.org>2008-05-27 09:45:18 +0000
committerremko <remko@FreeBSD.org>2008-05-27 09:45:18 +0000
commit87fbf5762c02a0e9d828b5b8cd889c16d7ea8942 (patch)
treeea6b8e1eeb9be6b6a48de9e511fbd438e165cac8
parentba19039d12b3ea341bcdcda45c7b85bfb6da19b1 (diff)
downloadFreeBSD-src-87fbf5762c02a0e9d828b5b8cd889c16d7ea8942.zip
FreeBSD-src-87fbf5762c02a0e9d828b5b8cd889c16d7ea8942.tar.gz
Limit the EOF marker length to a maximum of 79
characters. [1] Add $FreeBSD$ tag so that I can actually commit this. PR: bin/118782 Reported by: Bjoern Koenig Patch by: edwin, Jaakko Heinonen (not used patch) MFC after: 1 week Approved by: imp (mentor, implicit)
-rw-r--r--usr.bin/shar/shar.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/shar/shar.sh b/usr.bin/shar/shar.sh
index bf541c0..6db7eda 100644
--- a/usr.bin/shar/shar.sh
+++ b/usr.bin/shar/shar.sh
@@ -33,6 +33,7 @@
#
# @(#)shar.sh 8.1 (Berkeley) 6/6/93
#
+# $FreeBSD$
if [ $# -eq 0 ]; then
echo 'usage: shar file ...' 1>&2
@@ -70,10 +71,12 @@ do
echo "echo c - $i"
echo "mkdir -p $i > /dev/null 2>&1"
else
+ md5sum=`echo -n $i | md5`
+ eofmarker="END-of-$md5sum"
echo "echo x - $i"
- echo "sed 's/^X//' >$i << 'END-of-$i'"
+ echo "sed 's/^X//' >$i << '$md5sum'"
sed 's/^/X/' $i || exit
- echo "END-of-$i"
+ echo "$md5sum"
fi
done
echo exit
OpenPOWER on IntegriCloud