1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2024-12-23 23:51:50 +01:00

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

View File

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