From 18b8019ee3082625adf45025d1cb9e896269e7fc Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Mon, 26 Jun 2023 09:13:58 -0400 Subject: allow blank lines in partition.conf files --- src/partvi | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/partvi b/src/partvi index 673b141..29ff414 100755 --- a/src/partvi +++ b/src/partvi @@ -18,12 +18,13 @@ validate_name() read_config_file() { validate_name "$img" || { warn "invalid name: $img"; return 1; } - while read line + while read do - line=${line%%#*} # ignore comments - k=${line%%=*} - v=${line#*=} - [ "$k" -a "$k" != "$line" ] || return + REPLY=${REPLY%%#*} # ignore comments + [ "$REPLY" ] || continue # ignore empty lines + k=${REPLY%%=*} + v=${REPLY#*=} + [ "$k" -a "$k" != "$REPLY" ] || return eval "conf_${img}_$k=\$v" done < "$img".conf } -- cgit v1.2.3