git: 9b70262b0807 - stable/13 - 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, 25 Feb 2025 00:38:17 UTC
The branch stable/13 has been updated by cy:
URL: https://cgit.FreeBSD.org/src/commit/?id=9b70262b08076ecde0262173e33d9cfc805b14b5
commit 9b70262b08076ecde0262173e33d9cfc805b14b5
Author: Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2025-01-02 03:35:31 +0000
Commit: Cy Schubert <cy@FreeBSD.org>
CommitDate: 2025-02-25 00:38:10 +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
(cherry picked from commit 1080f5315427b382221651b342227b4923106f83)
---
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 77ef3789c8b3..f7496716acba 100644
--- a/usr.bin/shar/shar.sh
+++ b/usr.bin/shar/shar.sh
@@ -64,14 +64,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