From 6f00ab6ac2bc8d78aa6ea22aae7915f71b334512 Mon Sep 17 00:00:00 2001 From: werner Date: Fri, 14 Aug 2009 22:12:16 +0000 Subject: [PATCH] - KiCad is very liberal when it comes to valid part names, and so are we now (i.e., we now accept anything but control and non-ASCII characters) git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5446 99fdad57-331a-0410-800a-d7fa5415bdb3 --- fpd.y | 2 +- gui_frame.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fpd.y b/fpd.y index 2924439..8d0ca36 100644 --- a/fpd.y +++ b/fpd.y @@ -207,7 +207,7 @@ part_name: YYABORT; } for (p = $2; *p; *p++) - if (!is_id_char(*p, 0)) { + if (*p < 32 || *p > 126) { yyerrorf("invalid part name"); YYABORT; } diff --git a/gui_frame.c b/gui_frame.c index faf636f..5ae2501 100644 --- a/gui_frame.c +++ b/gui_frame.c @@ -1120,9 +1120,11 @@ static int validate_part_name(const char *s, void *ctx) { if (!*s) return 0; - while (*s) - if (!is_id_char(*s++, 0)) + while (*s) { + if (*s < 32 || *s > 126) return 0; + s++; + } return 1; }