bug avec l'utilisation de gensub()

This commit is contained in:
Jephté Clain 2018-01-23 11:07:48 +04:00
parent bda961fc5b
commit bdd859c5ae
2 changed files with 3 additions and 3 deletions

View File

@ -399,9 +399,9 @@ function write_unseen(write_section, wrote_section) {
splitvar "$param" name value
script="$script
in_section && \$0 ~ /^[ $TAB]*((##*|;;*)[ $TAB]*)?$name[ $TAB]*=/ {
\$0 = gensub(/^[ $TAB]*(##*|;;*)[ $TAB]*($name[ $TAB]*=)/, \"\\\\2\", \"\")
\$0 = gensub(/^[ $TAB]*(##*|;;*)[ $TAB]*($name[ $TAB]*=)/, \"\\\\2\", 1)
if (hasvalues[$i]) {
\$0 = gensub(/^([ $TAB]*$name[ $TAB]*=[ $TAB]*).*\$/, \"\\\\1\" values[$i], \"\")
\$0 = gensub(/^([ $TAB]*$name[ $TAB]*=[ $TAB]*).*\$/, \"\\\\1\" values[$i], 1)
}
seen[$i] = 1
modified = 0

View File

@ -169,7 +169,7 @@ function write_unseen() {
name="${param%%=*}"
script="$script
\$0 ~ /^[ $TAB]*(##*[ $TAB]*)?$name[ $TAB]*=/ {
\$0 = gensub(/^([ $TAB]*##*)?([ $TAB]*$name[ $TAB]*=[ $TAB]*).*\$/, \"\\\\2\" values[$i], \"\")
\$0 = gensub(/^([ $TAB]*##*)?([ $TAB]*$name[ $TAB]*=[ $TAB]*).*\$/, \"\\\\2\" values[$i], 1)
seen[$i] = 1
}"
let i=$i+1