r5731 - trunk/eda/fped

werner at docs.openmoko.org werner at docs.openmoko.org
Tue Dec 1 11:50:56 CET 2009


Author: werner
Date: 2009-12-01 11:50:55 +0100 (Tue, 01 Dec 2009)
New Revision: 5731

Modified:
   trunk/eda/fped/expr.c
   trunk/eda/fped/inst.c
Log:
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 [...]"



Modified: trunk/eda/fped/expr.c
===================================================================
--- trunk/eda/fped/expr.c	2009-12-01 02:08:34 UTC (rev 5730)
+++ trunk/eda/fped/expr.c	2009-12-01 10:50:55 UTC (rev 5731)
@@ -380,8 +380,14 @@
 		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--;

Modified: trunk/eda/fped/inst.c
===================================================================
--- trunk/eda/fped/inst.c	2009-12-01 02:08:34 UTC (rev 5730)
+++ trunk/eda/fped/inst.c	2009-12-01 10:50:55 UTC (rev 5731)
@@ -792,6 +792,7 @@
 {
 	char *tmp;
 
+	status_begin_reporting();
 	tmp = expand(s, NULL);
 	if (!tmp)
 		return 0;




More information about the commitlog mailing list