device.c, #7/19, use a local wordlist *wn
This commit is contained in:
parent
50dd15093e
commit
01039f81a2
|
|
@ -1161,15 +1161,16 @@ com_alter_common(wordlist *wl, int do_model)
|
||||||
if (strlen(argument) == 1) {
|
if (strlen(argument) == 1) {
|
||||||
wl2 = wlin;
|
wl2 = wlin;
|
||||||
} else if (strlen(argument) > 1) {
|
} else if (strlen(argument) > 1) {
|
||||||
wl2 = NULL;
|
wordlist *wn = NULL;
|
||||||
if (eqptr[1])
|
if (eqptr[1])
|
||||||
wl2 = wl_cons(copy(eqptr + 1), wl2);
|
wn = wl_cons(copy(eqptr + 1), wn);
|
||||||
wl2 = wl_cons(copy("="), wl2);
|
wn = wl_cons(copy("="), wn);
|
||||||
if (eqptr > argument)
|
if (eqptr > argument)
|
||||||
wl2 = wl_cons(copy_substring(argument, eqptr), wl2);
|
wn = wl_cons(copy_substring(argument, eqptr), wn);
|
||||||
/* combine wordlists into wl2, free wl */
|
/* combine wordlists into wn, free wl */
|
||||||
wl_splice(wl, wl2);
|
wl_splice(wl, wn);
|
||||||
/* step back in the wordlist, if we have moved forward, to catch 'm1' */
|
/* step back in the wordlist, if we have moved forward, to catch 'm1' */
|
||||||
|
wl2 = wn;
|
||||||
for (i = step; i > 0; i--)
|
for (i = step; i > 0; i--)
|
||||||
wl2 = wl2->wl_prev;
|
wl2 = wl2->wl_prev;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue