diff options
author | Andrew Cady <d@jerkface.net> | 2023-06-26 09:13:58 -0400 |
---|---|---|
committer | u <u@billy> | 2023-11-17 08:46:49 -0500 |
commit | 18b8019ee3082625adf45025d1cb9e896269e7fc (patch) | |
tree | 974a8cafbae331ca3f8f3c137a35e65e7b1bca86 | |
parent | a4a4f588d4c0aeb5e1d580196f02c54e75197683 (diff) |
allow blank lines in partition.conf files
-rwxr-xr-x | src/partvi | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -18,12 +18,13 @@ validate_name() | |||
18 | read_config_file() | 18 | read_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 | } |