1
0
Fork 0

avoid strtonum (a GNU AWK extension)

this drops the requirements on strtonum, making the script (AFAIK)
POSIX compliant.  This (ab)uses the fact that `+' will cast its
operator to numbers.

Tested with GNU AWK and "The One True AWK" on OpenBSD.
This commit is contained in:
Omar Polo 2021-02-26 19:18:48 +00:00
parent 8230056152
commit 0571c43c1c
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ BEGIN {
function split_version_number (version, parsed) {
split(version, parsed, VERSION_SEP);
for (i in parsed) {
parsed[i] = strtonum(parsed[i]);
parsed[i] = parsed[i] + 0;
}
}