* src/wordsplit.c (wordsplit_finish): Fix typo.
(wsplt_assign_param): Use _wsplt_seterr
This commit is contained in:
Sergey Poznyakoff 2019-05-15 14:13:50 +03:00
parent c62f40dee0
commit 070813ec0e

View file

@ -837,7 +837,7 @@ wordsplit_finish (struct wordsplit *wsp)
} }
else else
{ {
wsp->ws_error = WRDSE_EOF; wsp->ws_errno = WRDSE_EOF;
return WRDSE_EOF; return WRDSE_EOF;
} }
goto again; goto again;
@ -1163,7 +1163,7 @@ wsplt_assign_param (struct wordsplit *wsp, int param_idx, char *value)
char *v; char *v;
if (param_idx < 0) if (param_idx < 0)
return WRDSE_BADPARAM; return _wsplt_seterr (wsp, WRDSE_BADPARAM);
if (param_idx == wsp->ws_paramc) if (param_idx == wsp->ws_paramc)
{ {
char **parambuf; char **parambuf;
@ -1210,7 +1210,7 @@ wsplt_assign_param (struct wordsplit *wsp, int param_idx, char *value)
wsp->ws_paramc = param_idx + 1; wsp->ws_paramc = param_idx + 1;
} }
else if (param_idx > wsp->ws_paramc) else if (param_idx > wsp->ws_paramc)
return WRDSE_BADPARAM; return _wsplt_seterr (wsp, WRDSE_BADPARAM);
v = strdup (value); v = strdup (value);
if (!v) if (!v)