The documentation says that, for a one-line string, all whitespace
immediately following the identifier is deleted.
It does not say that anything happens to other withespace on the line,
but it turns out that consecutive sequences of whitespace are replaced
by a single space. This is unexpected.
Fix up the script so that doesn't happen, and add a test for this.
vars[num_vars++] = ident;
}
- current_l10n = !sub(/^[&]/, "", $1);
+ current_l10n = !sub(/^[&]/, "");
startline = NR;
ident = $1;
- $1 = collected = "";
+ collected = "";
+ sub(/^[^ \t]*/, "");
}
ident != "" {
\ leading whitespace
&j oneline
# with a comment
+&k with nontrivial whitespace
]])
AT_CHECK([$AWK -f "$srcdir/scripts/gen-strtab.awk" <test.def >test.h])
---
oneline
---
+with nontrivial whitespace
+---
], [ignore])
AT_CLEANUP