Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/sysinst Revert 1.4, that just trades one problem fo...



details:   https://anonhg.NetBSD.org/src/rev/389c53b899d5
branches:  trunk
changeset: 1022327:389c53b899d5
user:      kre <kre%NetBSD.org@localhost>
date:      Mon Jul 12 19:03:20 2021 +0000

description:
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.

diffstat:

 usr.sbin/sysinst/msg_xlat.sh |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r bb419f34d5e2 -r 389c53b899d5 usr.sbin/sysinst/msg_xlat.sh
--- a/usr.sbin/sysinst/msg_xlat.sh      Mon Jul 12 18:42:39 2021 +0000
+++ b/usr.sbin/sysinst/msg_xlat.sh      Mon Jul 12 19:03:20 2021 +0000
@@ -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 @@
                $IGNORE_MISSING_TRANSLATIONS || rval=1
        fi
 done
-IFS=%
+unset IFS
 
 if $count_fmtargs; then exit $rval; fi
 
@@ -210,7 +210,7 @@
 do
        eval msg=\${MSGTEXT_$msgnum}
        if [ -z "$msg" ]; then continue; fi
-       printf '%s\0' $msg
+       printf '%s\0' "$msg"
 done
 
 exit $rval



Home | Main Index | Thread Index | Old Index