1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-11-22 14:31:53 +02:00

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
This commit is contained in:
werner 2009-12-01 10:50:55 +00:00
parent 1613d4bdbc
commit 9cd195bf5b
2 changed files with 9 additions and 2 deletions

8
expr.c
View File

@ -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)
if (s == s0) {
if (*s)
goto invalid;
else {
fail("incomplete variable name");
goto fail;
}
}
var = strnalloc(s0, s-s0);
len -= s-s0+1;
s--;

1
inst.c
View File

@ -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;