From ea8d2509999b5f7f17c9a0a2f77df9ddc4a6d162 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 28 Oct 2010 18:12:27 +0000 Subject: [PATCH] bug fix, incorrect handling of `co_spiceonly' commands --- ChangeLog | 6 ++++++ src/frontend/commands.c | 2 +- src/frontend/control.c | 10 ++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c377a5f61..91ebef5df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-10-28 Robert Larice + * src/frontend/commands.c , + * src/frontend/control.c : + bug fix, incorrect handling of `co_spiceonly' commands + http://sourceforge.net/tracker/?func=detail&aid=3092998&group_id=38962&atid=423915 + 2010-10-27 Robert Larice * src/frontend/device.c : bug fix, const data space was used, instead of malloced area diff --git a/src/frontend/commands.c b/src/frontend/commands.c index cc3337b6a..50a1488f8 100644 --- a/src/frontend/commands.c +++ b/src/frontend/commands.c @@ -911,7 +911,7 @@ struct comm nutcp_coms[] = { { 0, 0, 0, 0 }, E_DEFHMASK, 3, 3, NULL, "varname s1 s2 : Set $varname to strcmp(s1, s2)." } , - { "linearize", NULL, FALSE, FALSE, + { "linearize", com_linearize, TRUE, FALSE, { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, NULL, " [ vec ... ] : Convert plot into one with linear scale." } , diff --git a/src/frontend/control.c b/src/frontend/control.c index c62fdd5af..dfcffcf64 100644 --- a/src/frontend/control.c +++ b/src/frontend/control.c @@ -209,11 +209,13 @@ docommand(wordlist *wlist) s, cp_program); goto out; + /* If it hasn't been implemented */ + } else if (!cp_coms[i].co_func) { + fprintf(cp_err,"%s: command is not implemented\n", s); + goto out; /* If it's there but spiceonly, and this is nutmeg, error. */ - } else if (!cp_coms[i].co_func && ft_nutmeg && - (cp_coms[i].co_spiceonly)) { - fprintf(cp_err,"%s: command available only in spice\n", - s); + } else if (ft_nutmeg && cp_coms[i].co_spiceonly) { + fprintf(cp_err,"%s: command available only in spice\n", s); goto out; }