diff options
-rw-r--r-- | editors/awk.c | 2 | ||||
-rwxr-xr-x | testsuite/awk.tests | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/editors/awk.c b/editors/awk.c index bc8b0dad1..b9bc01f16 100644 --- a/editors/awk.c +++ b/editors/awk.c | |||
@@ -1046,7 +1046,7 @@ static uint32_t next_token(uint32_t expected) | |||
1046 | *(p-1) = '\0'; | 1046 | *(p-1) = '\0'; |
1047 | tc = TC_VARIABLE; | 1047 | tc = TC_VARIABLE; |
1048 | /* also consume whitespace between functionname and bracket */ | 1048 | /* also consume whitespace between functionname and bracket */ |
1049 | if (!(expected & TC_VARIABLE)) | 1049 | if (!(expected & TC_VARIABLE) || (expected & TC_ARRAY)) |
1050 | skip_spaces(&p); | 1050 | skip_spaces(&p); |
1051 | if (*p == '(') { | 1051 | if (*p == '(') { |
1052 | tc = TC_FUNCTION; | 1052 | tc = TC_FUNCTION; |
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index 7910c8875..03d464969 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests | |||
@@ -64,4 +64,7 @@ testing "awk string cast (bug 725)" \ | |||
64 | "0\nnumber\n" \ | 64 | "0\nnumber\n" \ |
65 | "" "" | 65 | "" "" |
66 | 66 | ||
67 | testing "awk handles whitespace before array subscript" \ | ||
68 | "awk 'BEGIN { arr [3] = 1; print arr [3] }'" "1\n" "" "" | ||
69 | |||
67 | exit $FAILCOUNT | 70 | exit $FAILCOUNT |