fix several bugs

This commit is contained in:
leitner
2004-03-12 23:21:24 +00:00
parent 7bf8213396
commit 989695af67
7 changed files with 54 additions and 11 deletions

View File

@@ -11,10 +11,11 @@ int matchstring(struct string* s,const char* c) {
c=bstrfirst(c);
i=byte_diff(s->s,l1,c);
if (i) return i;
/* one is a prefix of the other */
/* same length? */
if (l==s->l) return 0;
if (c[l1]) /* is c the longer string? */
/* one is a prefix of the other */
if (l1<l) /* we cut off c */
return c[l1];
return -(int)(s->s[l1]);
return (int)(s->s[l1]);
}