From 01039f81a2e5b7347babdfe5890fd08bf0ecb8d6 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 10 Jun 2017 09:30:59 +0200 Subject: [PATCH] device.c, #7/19, use a local wordlist *wn --- src/frontend/device.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/frontend/device.c b/src/frontend/device.c index 61ea0f93f..ca9aee3f5 100644 --- a/src/frontend/device.c +++ b/src/frontend/device.c @@ -1161,15 +1161,16 @@ com_alter_common(wordlist *wl, int do_model) if (strlen(argument) == 1) { wl2 = wlin; } else if (strlen(argument) > 1) { - wl2 = NULL; + wordlist *wn = NULL; if (eqptr[1]) - wl2 = wl_cons(copy(eqptr + 1), wl2); - wl2 = wl_cons(copy("="), wl2); + wn = wl_cons(copy(eqptr + 1), wn); + wn = wl_cons(copy("="), wn); if (eqptr > argument) - wl2 = wl_cons(copy_substring(argument, eqptr), wl2); - /* combine wordlists into wl2, free wl */ - wl_splice(wl, wl2); + wn = wl_cons(copy_substring(argument, eqptr), wn); + /* combine wordlists into wn, free wl */ + wl_splice(wl, wn); /* step back in the wordlist, if we have moved forward, to catch 'm1' */ + wl2 = wn; for (i = step; i > 0; i--) wl2 = wl2->wl_prev; }