From c09839b2090be4980e79ec64b5f48a9da5a75685 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sat, 6 Nov 2021 13:05:39 +0100 Subject: [PATCH] Enable math characters in vector (node) names for commands write and print Replace ft_getpnames() by ft_getpnames_quotes(). --- src/frontend/postcoms.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/frontend/postcoms.c b/src/frontend/postcoms.c index 02fca808c..44c974e19 100644 --- a/src/frontend/postcoms.c +++ b/src/frontend/postcoms.c @@ -24,6 +24,8 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group #include "plotting/plotting.h" #include "ngspice/compatmode.h" +#include "ngspice/dstring.h" +#include "numparam/general.h" static void killplot(struct plot *pl); static void DelPlotWindows(struct plot *pl); @@ -47,7 +49,6 @@ is_scale_vec_of_current_plot(const char *v_name) } /* end of function is_scale_vec_of_current_plot */ - /* Remove vectors in the wordlist from the current plot */ void com_unlet(wordlist *wl) @@ -147,7 +148,9 @@ com_print(wordlist *wl) } ngood = 0; - names = ft_getpnames(wl, TRUE); + + names = ft_getpnames_quotes(wl, TRUE); + for (pn = names; pn; pn = pn->pn_next) { if ((v = ft_evaluate(pn)) == NULL) continue; @@ -461,9 +464,9 @@ com_write(wordlist *wl) We offer plain writing of the vectors. This enables node names containing +, -, / etc. */ if (!plainwrite) { if (wl) - names = ft_getpnames(wl, TRUE); + names = ft_getpnames_quotes(wl, TRUE); else - names = ft_getpnames(&all, TRUE); + names = ft_getpnames_quotes(&all, TRUE); if (names == NULL) { return;