← Commit list

d03cd3be2

Alexander Shishkin
Alexander Shishkin
2010-02-26
FAILED Duration: 38s

Subject

awk: skip whitespace between array name and subscript

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

editors/awk.c+1 -1
@@ -1046,7 +1046,7 @@ static uint32_t next_token(uint32_t expected)
*(p-1) = '\0';
tc = TC_VARIABLE;
/* also consume whitespace between functionname and bracket */
- if (!(expected & TC_VARIABLE))
+ if (!(expected & TC_VARIABLE) || (expected & TC_ARRAY))
skip_spaces(&p);
if (*p == '(') {
tc = TC_FUNCTION;
testsuite/awk.tests+3 -0
@@ -64,4 +64,7 @@ testing "awk string cast (bug 725)" \
"0\nnumber\n" \
"" ""
+testing "awk handles whitespace before array subscript" \
+ "awk 'BEGIN { arr [3] = 1; print arr [3] }'" "1\n" "" ""
+
exit $FAILCOUNT