From 1f0d7b25c5adc7b581f4c98c614291a89ac9050b Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Wed, 23 Sep 2009 14:36:19 +0000 Subject: parse only once usb.ids (avoids displaying Duplicate errors) --- names.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'names.c') diff --git a/names.c b/names.c index d9ed81a..a39425d 100644 --- a/names.c +++ b/names.c @@ -138,6 +138,8 @@ static struct genericstrtable *hutus[HASHSZ] = { NULL, }; static struct genericstrtable *langids[HASHSZ] = { NULL, }; static struct genericstrtable *countrycodes[HASHSZ] = { NULL, }; +static int init_done = 0; + /* ---------------------------------------------------------------------- */ static const char *names_genericstrtable(struct genericstrtable *t[HASHSZ], unsigned int index) @@ -799,7 +801,9 @@ static void parse(usb_file f) int names_init(char *n) { usb_file f; - + if(init_done) + return 0; + init_done = 1; if (!(f = usb_fopen(n, "r"))) { return errno; } -- cgit v1.2.1