From fa5586ebd4138be644381ea25b8400dc3d6cb126 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Tue, 11 Apr 2017 19:20:37 +0200 Subject: [PATCH] device.c, do not use "" token that occurs if ' =' or '= ' are enterd manually in the alter command --- src/frontend/device.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/frontend/device.c b/src/frontend/device.c index 0e90f7ac9..87c075ef2 100644 --- a/src/frontend/device.c +++ b/src/frontend/device.c @@ -1166,10 +1166,12 @@ com_alter_common(wordlist *wl, int do_model) wl2 = wlin; wl = NULL; } else if (strlen(argument) > 1) { - wl2 = wl_cons(copy_substring(argument, eqptr), - wl_cons(copy("="), - wl_cons(copy(eqptr + 1), - NULL))); + wl2 = NULL; + if (eqptr[1]) + wl2 = wl_cons(copy(eqptr + 1), wl2); + wl2 = wl_cons(copy("="), wl2); + if (eqptr > argument) + wl2 = wl_cons(copy_substring(argument, eqptr), wl2); /* combine wordlists into wl2, free wl */ wl_splice(wl, wl2); wl = NULL;