Minor fix

* src/wordsplit.c (scan_word): Ignore trailing whitespace.
This commit is contained in:
Sergey Poznyakoff 2009-11-26 23:31:37 +02:00
parent 52e27f35f0
commit 9c5f3ad72c

View file

@ -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;