From 524733f9dee8cb804f5500e15f9f67d1eb13cb92 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Wed, 22 Jan 2020 22:30:07 +0100 Subject: [PATCH] allow vec_get to verify vectors if their names are quoted by "" --- src/frontend/vectors.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/frontend/vectors.c b/src/frontend/vectors.c index 15f994176..72d31e3ff 100644 --- a/src/frontend/vectors.c +++ b/src/frontend/vectors.c @@ -253,7 +253,6 @@ static struct dvec *find_permanent_vector_by_name( NGHASHPTR pl_lookup_table, char *name) { struct dvec *d; - /* Find the first vector with the given name and then find others * until one having the VF_PERMANENT flag set is found. */ for (d = nghash_find(pl_lookup_table, name); @@ -264,7 +263,18 @@ static struct dvec *find_permanent_vector_by_name( return d; } } /* end of loop over vectors in the plot having this name */ - + /* try again, this time without quotes around the name */ + char *nname = cp_unquote(name); + for (d = nghash_find(pl_lookup_table, nname); + d; + d = nghash_find_again(pl_lookup_table, nname)) { + if (d->v_flags & VF_PERMANENT) { + /* A "permanent" vector was found with the name, so done */ + tfree(nname); + return d; + } + } /* end of loop over vectors in the plot having this name */ + tfree(nname); return (struct dvec *) NULL; /* not found */ } /* end of function find_permanent_vector_by_name */