[Debootloaders-devel] r93 - trunk/rsrce
Jeremie Koenig
jkoenig-guest at costa.debian.org
Wed Jul 12 07:26:09 UTC 2006
Author: jkoenig-guest
Date: 2006-07-12 07:26:05 +0000 (Wed, 12 Jul 2006)
New Revision: 93
Modified:
trunk/rsrce/translate.c
Log:
more explicit translator table scan
Modified: trunk/rsrce/translate.c
===================================================================
--- trunk/rsrce/translate.c 2006-07-12 07:09:44 UTC (rev 92)
+++ trunk/rsrce/translate.c 2006-07-12 07:26:05 UTC (rev 93)
@@ -160,15 +160,18 @@
struct translator *tr_lookup(struct resource *r, const char *ext)
{
+ struct translator *tr;
restype_t type;
- int i;
res_gettype(r, type);
- for(i=0 ; tr_table[i].ext ; i++)
- if(!((tr_table[i].type[0]
- && memcmp(tr_table[i].type, type, sizeof(type)))
- || (ext && strcmp(tr_table[i].ext, ext))))
- return tr_table + i;
+ for(tr = tr_table ; tr->export ; tr++) {
+ if(tr->type[0] && memcmp(tr->type, type, sizeof type))
+ continue;
+ if(ext && tr->ext && strcmp(tr->ext, ext))
+ continue;
+
+ return tr;
+ }
return NULL;
}
More information about the Debootloaders-devel
mailing list