Minor fixes

* README: Fix typo in example.
* wordsplit.c (wordsplit_run): Make sure _wsplt_seterr gets correct flags.
This commit is contained in:
Sergey Poznyakoff 2025-03-11 20:33:58 +02:00
parent 7885c2aacd
commit 0e1a09c4c7
2 changed files with 6 additions and 2 deletions

2
README
View file

@ -204,7 +204,7 @@ Then, add the following fragment to build the auxiliary files:
else \
wsversion="unknown"; \
fi;\
echo "#define WORDSPLIT_VERSION \"$wsversion\""; } > \
echo "#define WORDSPLIT_VERSION \"$$wsversion\""; } > \
> $(srcdir)/wordsplit-version.h
AM_CPPFLAGS += -DHAVE_WORDSPLIT_VERSION_H

View file

@ -2713,7 +2713,11 @@ wordsplit_run (const char *command, size_t length, struct wordsplit *wsp,
if (!command)
{
if (!(flags & WRDSF_INCREMENTAL))
return _wsplt_seterr (wsp, WRDSE_USAGE);
{
/* Make sure _wsplt_seterr gets correct flags. */
wsp->ws_flags = flags;
return _wsplt_seterr (wsp, WRDSE_USAGE);
}
if (wsp->ws_head)
return wordsplit_finish (wsp);