From 0e1a09c4c74426996e4bccb26f500e300c73aed6 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Tue, 11 Mar 2025 20:33:58 +0200 Subject: [PATCH] Minor fixes * README: Fix typo in example. * wordsplit.c (wordsplit_run): Make sure _wsplt_seterr gets correct flags. --- README | 2 +- wordsplit.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README b/README index 2d315ae..bfd1bb6 100644 --- a/README +++ b/README @@ -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 diff --git a/wordsplit.c b/wordsplit.c index ea502df..59830f0 100644 --- a/wordsplit.c +++ b/wordsplit.c @@ -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);