diff options
author | Klemens Nanni <kn@cvs.openbsd.org> | 2023-04-01 23:24:47 +0000 |
---|---|---|
committer | Klemens Nanni <kn@cvs.openbsd.org> | 2023-04-01 23:24:47 +0000 |
commit | 26a91aec78f7e4266a4b5fd4688478beb7a48591 (patch) | |
tree | 3628b2ba73e6b184740d9705200fe563ca12aa52 /distrib/miniroot | |
parent | a8e388f14de082fa1bd8dee349c0a47037b623e7 (diff) |
Limit IFS scope to effect parsing code only
Set to split `hw.disknames' strings is neat, but functionn-wide means the
bsort() invocation honours it, i.e. it'll output newlines not spaces.
Break the one-liner into the same multi-line idom occuring elsewhere and
contain IFS in the subshell that needs it.
This was never visible due how the output of was consumed by the shell.
The only visual, but otherwise effectless bug due to this appeared with the
new disk encryption question double-quoting get_dkdevs() output, i.e.
multiple disks printed across multiple lines; this yields one, as inteded.
OK afresh1
Diffstat (limited to 'distrib/miniroot')
-rw-r--r-- | distrib/miniroot/install.sub | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 537a9ae3612..71496e89326 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1237 2023/03/29 17:40:24 kn Exp $ +# $OpenBSD: install.sub,v 1.1238 2023/04/01 23:24:46 kn Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org> @@ -297,9 +297,10 @@ scan_dmesg() { # Extract device names from hw.disknames matching sed expression $1. scan_disknames() { - local IFS=, _disks=$(sysctl -n hw.disknames) - - bsort $(for _n in $_disks; do echo "${_n%%:*} "; done | sed -n "$1") + bsort $(IFS=, + for _d in $(sysctl -n hw.disknames); do + echo "${_d%%:*} " + done | sed -n "$1") } # Return list of disks with softraid chunks, optionally limited to the volume $1. |