diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-05-16 09:24:21 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-05-16 09:24:21 +0300 |
commit | 7d5d82970b2e6b3e51b8a64f5e706b95986227ff (patch) | |
tree | d3e90d99a2a3ca967513f6230b82d0c69b572c53 | |
parent | 78537d63fecd694cc718a24c0625fcbb614760cf (diff) | |
download | rush-7d5d82970b2e6b3e51b8a64f5e706b95986227ff.tar.gz rush-7d5d82970b2e6b3e51b8a64f5e706b95986227ff.tar.bz2 |
Synch with grecs 1fa2dd2c
-rw-r--r-- | lib/wordsplit.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/wordsplit.c b/lib/wordsplit.c index 6dba914..48312bb 100644 --- a/lib/wordsplit.c +++ b/lib/wordsplit.c @@ -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 |