mirror of
git://git.gnu.org.ua/wordsplit.git
synced 2025-04-25 16:19:54 +03:00
Minor fix.
* src/wordsplit.c (_wsplt_seterr_sub): Propagate error context.
This commit is contained in:
parent
e4bd61ae6b
commit
6c37c44ee0
1 changed files with 6 additions and 0 deletions
|
@ -198,8 +198,10 @@ _wsplt_subsplit (struct wordsplit *wsp, struct wordsplit *wss,
|
|||
static void
|
||||
_wsplt_seterr_sub (struct wordsplit *wsp, struct wordsplit *wss)
|
||||
{
|
||||
/* Clear user-defined error */
|
||||
if (wsp->ws_errno == WRDSE_USERERR)
|
||||
free (wsp->ws_usererr);
|
||||
/* Copy error state */
|
||||
wsp->ws_errno = wss->ws_errno;
|
||||
if (wss->ws_errno == WRDSE_USERERR)
|
||||
{
|
||||
|
@ -207,6 +209,10 @@ _wsplt_seterr_sub (struct wordsplit *wsp, struct wordsplit *wss)
|
|||
wss->ws_errno = WRDSE_EOF;
|
||||
wss->ws_usererr = NULL;
|
||||
}
|
||||
/* Copy error context */
|
||||
free (wsp->ws_errctx);
|
||||
wsp->ws_errctx = wss->ws_errctx;
|
||||
wss->ws_errctx = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue