diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2006-12-10 08:01:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2006-12-10 08:01:00 -0800 |
commit | ae037e45038cca6f0b86abea50692399a03b01be (patch) | |
tree | 6419a88dd09a51011be3fa98199775ae3cf68fae /src/misc/nm | |
parent | b9abf9c00c02feb52a2c796199343acebe20d8ef (diff) | |
download | abc-ae037e45038cca6f0b86abea50692399a03b01be.tar.gz abc-ae037e45038cca6f0b86abea50692399a03b01be.tar.bz2 abc-ae037e45038cca6f0b86abea50692399a03b01be.zip |
Version abc61210
Diffstat (limited to 'src/misc/nm')
-rw-r--r-- | src/misc/nm/nmTable.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/misc/nm/nmTable.c b/src/misc/nm/nmTable.c index 94e46f04..f97a2f0b 100644 --- a/src/misc/nm/nmTable.c +++ b/src/misc/nm/nmTable.c @@ -187,12 +187,22 @@ Nm_Entry_t * Nm_ManTableLookupId( Nm_Man_t * p, int ObjId ) ***********************************************************************/ Nm_Entry_t * Nm_ManTableLookupName( Nm_Man_t * p, char * pName, int Type ) { - Nm_Entry_t * pEntry; + Nm_Entry_t * pEntry, * pTemp; int Counter = 0; for ( pEntry = p->pBinsN2I[ Nm_HashString(pName, p->nBins) ]; pEntry; pEntry = pEntry->pNextN2I ) + { + // check the entry itself if ( !strcmp(pEntry->Name, pName) && (Type == -1 || pEntry->Type == (unsigned)Type) ) return pEntry; - return pEntry; + // if there is no namesakes, continue + if ( pEntry->pNameSake == NULL ) + continue; + // check the list of namesakes + for ( pTemp = pEntry->pNameSake; pTemp != pEntry; pTemp = pTemp->pNameSake ) + if ( !strcmp(pTemp->Name, pName) && (Type == -1 || pTemp->Type == (unsigned)Type) ) + return pTemp; + } + return NULL; } /**Function************************************************************* |