============================================
* Original From: Paul Edwards, 3:711/934.9
* Original To : andrew clarke, 3:635/728.4
* Original Date: 1997-04-03 10:36
============================================
>> Does anyone have a clue how the name lookup works in a V7 nodelist? It
>> seems to be remarkably perverse. For example, if I enter "George
>> Peace" it comes up with 1:270/104, which is nodelisted as
"PEACE" and
>> doesn't like calls from strangers, rather than 1:270/101 which is
>> nodelisted as "GEORGE PEACE".
ac> You wrote the V7 lookup code, and I don't really understand it completely
FWIW, I thought it was just a facet of the nodelist compiler used, not to
do with the V7 code itself. Basically, the code always finds the first
match (where "first" is defined as "however the internal
representation happens to turn out with a particular compile"). I do
not know if you want to match "peace" or not, but anyway, it does
convert it into lastname, , can't remember if is initial
or name, but it's fairly irrelevant, that should all be correct. Ok, in
vsevops.c you have the following function:
static int compareSysop(void *a, void *b, int len)
{
return strncmpi((char *)a, (char *)b, len);
}
"len" is the length of the data record found in the index file,
which is variable "a". If you were instead to make that:
return strncmpi((char *)a, (char *)b, strlen((char *)a));
You would do a search of the full length, but then you would potentially be
comparing over bytes that don't belong to you (I'm not sure if a is
nul-terminated). So instead, you could do a strlen() and make sure the
lengths are exactly the same. Is that what you want? You need to specify
the user requirements. I often, but not always, compared to Msged 2.2e for
user-requirements. I can make that change if you want, tell me what you
want first. But like I say, it's an addition of a couple of lines of code
depending on what you want. Oh, you will need to return -1 or 1 as
appropriate, and I'd hazard a guess that if the strings are equal, except
that one is longer, then the longer one is the bigger one. So maybe 5
lines of code in that function. BFN. Paul.
@EOT:
---
* Origin: X (3:711/934.9)
|