author | ecalot
<ecalot> 2005-12-19 06:09:35 UTC |
committer | ecalot
<ecalot> 2005-12-19 06:09:35 UTC |
parent | d31ecc9e5f250a6cafffb9a36dbd4c0051b948e1 |
PR/src/lib/layers/idlist.c | +1 | -1 |
PR/src/lib/layers/resourcematch.c | +9 | -3 |
diff --git a/PR/src/lib/layers/idlist.c b/PR/src/lib/layers/idlist.c index 789fd7b..2358d15 100644 --- a/PR/src/lib/layers/idlist.c +++ b/PR/src/lib/layers/idlist.c @@ -206,7 +206,7 @@ int isInThePartialList(const char* vFile, tResourceId id) { if (!resIdCmp(id,partialList.list[i].field.id)) return 1; break; }*/ - if (runRM(partialList.list+i,repairFolders(vFile),&id)) return 1; + if (runRM(partialList.list+i,repairFolders(vFile?vFile:""),&id)) return 1; } return 0; } diff --git a/PR/src/lib/layers/resourcematch.c b/PR/src/lib/layers/resourcematch.c index 18a25e2..29c485e 100644 --- a/PR/src/lib/layers/resourcematch.c +++ b/PR/src/lib/layers/resourcematch.c @@ -135,6 +135,9 @@ int initRM(const char* text, tResourceMatch *r) { int runRM(const tResourceMatch *r, const char* path, const tResourceId *id) { int m=1; /* by default it matches */ + const char* null=""; + const char* rpath; + const char* rindex; #ifdef MATCH_DEBUG printf("Matching: path='%s', id=(%d,%s,%d) <=> flag=%x path='%s' id=(%d,%s,%d)\n", @@ -145,12 +148,15 @@ int runRM(const tResourceMatch *r, const char* path, const tResourceId *id) { r->value,r->index,r->order ); #endif - + /* replace NULL with null */ + rindex=r->index?r->index:null; + rpath=r->path?r->path:null; + /* compare each field */ compare(dOrd,r->order==id->order); compare(dVal,r->value==id->value); - compare(dInd,matchesIn(id->index,r->index)||matchesIn(translateInt2Ext(id->index),r->index)); - compare(dPat,matchesIn(path,r->path)); + compare(dInd,matchesIn(id->index,rindex)||matchesIn(translateInt2Ext(id->index),rindex)); + compare(dPat,matchesIn(path,rpath)); return m; }