Date: Tue, 25 Feb 2025 00:38:17 GMT From: Cy Schubert <cy@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 9b70262b0807 - stable/13 - shar: Handle special characters or white space in file names fed to shar Message-ID: <202502250038.51P0cHqv096961@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202502250038.51P0cHqv096961>