summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2023-06-26 09:13:58 -0400
committeru <u@billy>2023-11-17 08:46:49 -0500
commit18b8019ee3082625adf45025d1cb9e896269e7fc (patch)
tree974a8cafbae331ca3f8f3c137a35e65e7b1bca86
parenta4a4f588d4c0aeb5e1d580196f02c54e75197683 (diff)
allow blank lines in partition.conf files
-rwxr-xr-xsrc/partvi11
1 files 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()
18read_config_file() 18read_config_file()
19{ 19{
20 validate_name "$img" || { warn "invalid name: $img"; return 1; } 20 validate_name "$img" || { warn "invalid name: $img"; return 1; }
21 while read line 21 while read
22 do 22 do
23 line=${line%%#*} # ignore comments 23 REPLY=${REPLY%%#*} # ignore comments
24 k=${line%%=*} 24 [ "$REPLY" ] || continue # ignore empty lines
25 v=${line#*=} 25 k=${REPLY%%=*}
26 [ "$k" -a "$k" != "$line" ] || return 26 v=${REPLY#*=}
27 [ "$k" -a "$k" != "$REPLY" ] || return
27 eval "conf_${img}_$k=\$v" 28 eval "conf_${img}_$k=\$v"
28 done < "$img".conf 29 done < "$img".conf
29} 30}