device.c, #3/19, move some code up

This commit is contained in:
rlar 2017-06-08 09:16:01 +02:00
parent 670d87a589
commit 3baaa57d18
1 changed files with 6 additions and 3 deletions

View File

@ -1163,6 +1163,9 @@ com_alter_common(wordlist *wl, int do_model)
if (strlen(argument) == 1) {
step = -1;
wl2 = wlin;
/* step back in the wordlist, if we have moved forward, to catch 'm1' */
for (i = step; i > 0; i--)
wl2 = wl2->wl_prev;
} else if (strlen(argument) > 1) {
wl2 = NULL;
if (eqptr[1])
@ -1172,6 +1175,9 @@ com_alter_common(wordlist *wl, int do_model)
wl2 = wl_cons(copy_substring(argument, eqptr), wl2);
/* combine wordlists into wl2, free wl */
wl_splice(wl, wl2);
/* step back in the wordlist, if we have moved forward, to catch 'm1' */
for (i = step; i > 0; i--)
wl2 = wl2->wl_prev;
}
break;
}
@ -1184,9 +1190,6 @@ com_alter_common(wordlist *wl, int do_model)
}
if (eqfound) {
/* step back in the wordlist, if we have moved forward, to catch 'm1' */
for (i = step; i > 0; i--)
wl2 = wl2->wl_prev;
} else {
/* no equal sign found, probably a pre3f4 input format
'alter device value'