git: 1080f5315427 - main - shar: Handle special characters or white space in file names fed to shar
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 18 Feb 2025 17:17:19 UTC
The branch main has been updated by cy:
URL: https://cgit.FreeBSD.org/src/commit/?id=1080f5315427b382221651b342227b4923106f83
commit 1080f5315427b382221651b342227b4923106f83
Author: Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2025-01-02 03:35:31 +0000
Commit: Cy Schubert <cy@FreeBSD.org>
CommitDate: 2025-02-18 17:16:48 +0000
shar: Handle special characters or white space in file names fed to shar
Obtained from: NetBSD hg commit 365370:124268924386
MFC after: 1 week
---
usr.bin/shar/shar.sh | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/usr.bin/shar/shar.sh b/usr.bin/shar/shar.sh
index 13147c3bf4ed..3a7bf2db41e5 100644
--- a/usr.bin/shar/shar.sh
+++ b/usr.bin/shar/shar.sh
@@ -61,14 +61,14 @@ echo "#"
for i
do
- if [ -d $i ]; then
- echo "echo c - $i"
- echo "mkdir -p $i > /dev/null 2>&1"
+ if [ -d "$i" ]; then
+ echo "echo c - '$i'"
+ echo "mkdir -p '$i' > /dev/null 2>&1"
else
- md5sum=`echo -n $i | md5`
- echo "echo x - $i"
- echo "sed 's/^X//' >$i << '$md5sum'"
- sed 's/^/X/' $i || exit
+ md5sum=`echo -n "$i" | md5`
+ echo "echo x - '$i'"
+ echo "sed 's/^X//' >'$i' << '$md5sum'"
+ sed 's/^/X/' "$i" || exit
echo "$md5sum"
fi
done