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