Module Name:    src
Committed By:   kre
Date:           Wed Dec  5 09:20:18 UTC 2018

Modified Files:
        src/bin/sh: mkinit.sh

Log Message:
Use printf, rather than echo (via echo redefined as a function that
uses printf for simplicity).

This script runs using the build host's shell, and echo, and so must
deal with all of the absurdity that different versions of echo dumb
upon us.

This is the underlying cause of the linux build failure that gson@ reported.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/bin/sh/mkinit.sh

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

Modified files:

Index: src/bin/sh/mkinit.sh
diff -u src/bin/sh/mkinit.sh:1.9 src/bin/sh/mkinit.sh:1.10
--- src/bin/sh/mkinit.sh:1.9	Thu Oct 18 04:24:43 2018
+++ src/bin/sh/mkinit.sh	Wed Dec  5 09:20:18 2018
@@ -1,5 +1,5 @@
 #! /bin/sh
-#	$NetBSD: mkinit.sh,v 1.9 2018/10/18 04:24:43 kre Exp $
+#	$NetBSD: mkinit.sh,v 1.10 2018/12/05 09:20:18 kre Exp $
 
 # Copyright (c) 2003 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -30,6 +30,27 @@
 
 srcs="$*"
 
+# use of echo in this script is broken
+
+# some echo versions will expand \n in the args, which breaks C
+# Note: this script is a HOST_PROG ... it must run in the
+# build host's environment, with its shell.
+
+# Fortunately, use of echo here is also trivially simplistic,
+# we can easily replace all uses with ...
+
+echo()
+{
+	printf '%s\n' "$1"
+}
+
+# CAUTION: for anyone modifying this script.... use printf
+# rather than echo to output anything at all... then
+# you will avoid being bitten by the simplicity of this function.
+# This was done this way rather than wholesale replacement
+# to avoid unnecessary code churn.
+
+
 nl='
 '
 openparen='('

Reply via email to