Module Name:    src
Committed By:   kre
Date:           Mon Jul 12 19:03:20 UTC 2021

Modified Files:
        src/usr.sbin/sysinst: msg_xlat.sh

Log Message:
Revert 1.4, that just trades one problem for a different one
(splitting the message on % instead of white space, which affects
less messages, but makes a bigger mess of them when it happens).

The real problem is that the expansion of the message was unquoted,
which allowed the field splitting to happen at all (which was mitigated
by the way printf rescans its format string for each arg when there are
more args than conversions in the format) otherwise it would have been
a much bigger mess (both times).

Just add quotes where quotes are needed, no more splitting, all good.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/sysinst/msg_xlat.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sysinst/msg_xlat.sh
diff -u src/usr.sbin/sysinst/msg_xlat.sh:1.4 src/usr.sbin/sysinst/msg_xlat.sh:1.5
--- src/usr.sbin/sysinst/msg_xlat.sh:1.4	Sun Jul 11 10:51:46 2021
+++ src/usr.sbin/sysinst/msg_xlat.sh	Mon Jul 12 19:03:20 2021
@@ -1,5 +1,5 @@
 #! /bin/sh
-#	$NetBSD: msg_xlat.sh,v 1.4 2021/07/11 10:51:46 cjep Exp $
+#	$NetBSD: msg_xlat.sh,v 1.5 2021/07/12 19:03:20 kre Exp $
 
 #-
 # Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -174,7 +174,7 @@ do
 		$IGNORE_MISSING_TRANSLATIONS || rval=1
 	fi
 done
-IFS=%
+unset IFS
 
 if $count_fmtargs; then exit $rval; fi
 
@@ -210,7 +210,7 @@ while
 do
 	eval msg=\${MSGTEXT_$msgnum}
 	if [ -z "$msg" ]; then continue; fi
-	printf '%s\0' $msg
+	printf '%s\0' "$msg"
 done
 
 exit $rval

Reply via email to