1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-04 23:05:21 +02:00

genex/libs.c: skip ~ at the beginning of a component name

The ~ means that the component name is invisible.
This commit is contained in:
Werner Almesberger 2012-04-17 09:53:02 -03:00
parent a1d5e2dcef
commit 024ffd4e47

View File

@ -85,7 +85,7 @@ void add_lib(const char *path)
struct lib *lib; struct lib *lib;
struct entry *e = NULL; struct entry *e = NULL;
char buf[1024]; /* @@@ */ char buf[1024]; /* @@@ */
char *spc; char *name, *spc;
const char *s; const char *s;
file = fopen(path, "r"); file = fopen(path, "r");
@ -111,7 +111,10 @@ void add_lib(const char *path)
path); path);
exit(1); exit(1);
} }
spc = strchr(buf+4, ' '); name = buf+4;
if (*name == '~')
name++;
spc = strchr(name, ' ');
if (!spc) { if (!spc) {
fprintf(stderr, "invalid DEF line in %s\n", path); fprintf(stderr, "invalid DEF line in %s\n", path);
exit(1); exit(1);
@ -119,7 +122,7 @@ void add_lib(const char *path)
*spc = 0; *spc = 0;
e = alloc_type(struct entry); e = alloc_type(struct entry);
e->names = NULL; e->names = NULL;
add_name(e, buf+4); add_name(e, name);
e->units = atoi(s); e->units = atoi(s);
if (!e->units) { if (!e->units) {
fprintf(stderr, "invalid number of units in %s\n", fprintf(stderr, "invalid number of units in %s\n",