jcs's openbsd hax
openbsd

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

kn d9b045b4 42f826b2

+5 -4
+5 -4
distrib/miniroot/install.sub
··· 1 1 #!/bin/ksh 2 - # $OpenBSD: install.sub,v 1.1237 2023/03/29 17:40:24 kn Exp $ 2 + # $OpenBSD: install.sub,v 1.1238 2023/04/01 23:24:46 kn Exp $ 3 3 # 4 4 # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback 5 5 # Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org> ··· 297 297 298 298 # Extract device names from hw.disknames matching sed expression $1. 299 299 scan_disknames() { 300 - local IFS=, _disks=$(sysctl -n hw.disknames) 301 - 302 - bsort $(for _n in $_disks; do echo "${_n%%:*} "; done | sed -n "$1") 300 + bsort $(IFS=, 301 + for _d in $(sysctl -n hw.disknames); do 302 + echo "${_d%%:*} " 303 + done | sed -n "$1") 303 304 } 304 305 305 306 # Return list of disks with softraid chunks, optionally limited to the volume $1.