Enable math characters in vector (node) names for commands

write and print
Replace ft_getpnames() by ft_getpnames_quotes().
This commit is contained in:
Holger Vogt 2021-11-06 13:05:39 +01:00
parent 44c2e6295c
commit 3e725b00e7
1 changed files with 7 additions and 4 deletions

View File

@ -24,6 +24,8 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#include "plotting/plotting.h" #include "plotting/plotting.h"
#include "ngspice/compatmode.h" #include "ngspice/compatmode.h"
#include "ngspice/dstring.h"
#include "numparam/general.h"
static void killplot(struct plot *pl); static void killplot(struct plot *pl);
static void DelPlotWindows(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 */ } /* end of function is_scale_vec_of_current_plot */
/* Remove vectors in the wordlist from the current plot */ /* Remove vectors in the wordlist from the current plot */
void void
com_unlet(wordlist *wl) com_unlet(wordlist *wl)
@ -147,7 +148,9 @@ com_print(wordlist *wl)
} }
ngood = 0; ngood = 0;
names = ft_getpnames(wl, TRUE);
names = ft_getpnames_quotes(wl, TRUE);
for (pn = names; pn; pn = pn->pn_next) { for (pn = names; pn; pn = pn->pn_next) {
if ((v = ft_evaluate(pn)) == NULL) if ((v = ft_evaluate(pn)) == NULL)
continue; continue;
@ -461,9 +464,9 @@ com_write(wordlist *wl)
We offer plain writing of the vectors. This enables node names containing +, -, / etc. */ We offer plain writing of the vectors. This enables node names containing +, -, / etc. */
if (!plainwrite) { if (!plainwrite) {
if (wl) if (wl)
names = ft_getpnames(wl, TRUE); names = ft_getpnames_quotes(wl, TRUE);
else else
names = ft_getpnames(&all, TRUE); names = ft_getpnames_quotes(&all, TRUE);
if (names == NULL) { if (names == NULL) {
return; return;