summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2001-11-24 14:27:43 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2001-11-24 14:27:43 +0000
commitb50e76635844355014ba05285dc1afbbc97c1e9d (patch)
tree5274092213c65fdbd68886673f5309ec55b33bc3 /distrib
parent3225151e817493b1f4f91200c4c1e13abac78ffb (diff)
Fix bsort() so that trailing spaces are not emitted.
When a system is rebooted rather than power cycled it is possible for duplicate entries for a disk or cd to appear in the dmesg output. One from the previous boot and one from the current reboot. bsort() correctly filtered out the duplicates, but could emit a trailing space. This trailing space caused problems when, for instance, the root disk was being determined. With the trailing space present, the install or upgrade script would not fill in the default root disk, even if the system only had one disk.
Diffstat (limited to 'distrib')
-rw-r--r--distrib/miniroot/install.sub13
1 files changed, 11 insertions, 2 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 5a2fa4df9c9..cd508e44808 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: install.sub,v 1.176 2001/11/22 00:56:13 krw Exp $
+# $OpenBSD: install.sub,v 1.177 2001/11/24 14:27:42 krw Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997,1998 Todd Miller, Theo de Raadt
@@ -288,7 +288,16 @@ bsort() {
shift
done
- echo -n "$_a "; bsort $_l
+ echo -n $_a
+
+ # Prevent a trailing blank on the output, and thus a bad value
+ # for cutlast or cutword, by outputting blanks only when $_l
+ # has values to sort.
+
+ if [[ "X$_l" != "X" ]] ; then
+ echo -n " "
+ bsort $_l
+ fi
}
dir_has_sets() {