mirror of
git://git.gnu.org.ua/wordsplit.git
synced 2025-04-26 00:29:54 +03:00
Minor fix
* src/wordsplit.c (scan_word): Ignore trailing whitespace.
This commit is contained in:
parent
52e27f35f0
commit
9c5f3ad72c
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue