From 9cd195bf5b24a94d227fc21c4db366514fa08eb3 Mon Sep 17 00:00:00 2001 From: werner Date: Tue, 1 Dec 2009 10:50:55 +0000 Subject: [PATCH] When entering a name with variable expansion, the "invalid character in variable name" error was never cleared. - inst.c (validate_pad_name): call status_begin_reporting before expanding the string, to clear any previous error - expr.c (expand): if the last character in the name is a dollar sign, print "incomplete variable name" instead of "invalid character [...]" git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5731 99fdad57-331a-0410-800a-d7fa5415bdb3 --- expr.c | 10 ++++++++-- inst.c | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/expr.c b/expr.c index bd2463c..f43f72b 100644 --- a/expr.c +++ b/expr.c @@ -380,8 +380,14 @@ char *expand(const char *name, const struct frame *frame) if (*s != '{') { while (is_id_char(*s, s == s0)) s++; - if (s == s0) - goto invalid; + if (s == s0) { + if (*s) + goto invalid; + else { + fail("incomplete variable name"); + goto fail; + } + } var = strnalloc(s0, s-s0); len -= s-s0+1; s--; diff --git a/inst.c b/inst.c index 84c7b30..c4c9ffc 100644 --- a/inst.c +++ b/inst.c @@ -792,6 +792,7 @@ static int validate_pad_name(const char *s, void *ctx) { char *tmp; + status_begin_reporting(); tmp = expand(s, NULL); if (!tmp) return 0;