diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-11-26 23:31:37 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-11-26 23:31:37 +0200 |
commit | 79a1d947b38a60a2145f9b69e087004cd3b123d4 (patch) | |
tree | 09c3fc1d9b0f7ca2c870921e502ba1fa1f9bbe88 /src/wordsplit.c | |
parent | 03c385e51d8c0cdfb81abaec2be7111b41a9bc3a (diff) | |
download | grecs-79a1d947b38a60a2145f9b69e087004cd3b123d4.tar.gz grecs-79a1d947b38a60a2145f9b69e087004cd3b123d4.tar.bz2 |
Minor fix in wordsplit parser.
* src/wordsplit.c (scan_word): Ignore trailing whitespace.
* src/grecs-lex.l: Remove duplicate inclusion of config.h
Diffstat (limited to 'src/wordsplit.c')
-rw-r--r-- | src/wordsplit.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wordsplit.c b/src/wordsplit.c index 5469503..f51a845 100644 --- a/src/wordsplit.c +++ b/src/wordsplit.c @@ -22,6 +22,7 @@ #include <c-ctype.h> #include <errno.h> #include <unistd.h> +#include <stdlib.h> #include <string.h> #include <stdio.h> #include <wordsplit.h> @@ -196,8 +197,9 @@ scan_word (struct wordsplit *wsp, size_t *pstart, size_t *pend) if (wsp->ws_flags & WRDSF_WS) { /* Skip initial whitespace */ - while (i < len && isws (command[i])) - i++; + while (isws (command[i])) + if (++i == len) + return WRDSE_EOF; } start = i; |