diff options
Diffstat (limited to 'textproc/wordnet/files/patch-official')
-rw-r--r-- | textproc/wordnet/files/patch-official | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/textproc/wordnet/files/patch-official b/textproc/wordnet/files/patch-official index faca2552fe9b..1701ab0ccb2a 100644 --- a/textproc/wordnet/files/patch-official +++ b/textproc/wordnet/files/patch-official @@ -1,3 +1,14 @@ +This patch mostly contains the differences between the search.c as in +the released version 1.6 vs. the later version found in + ftp://ftp.cogsci.princeton.edu/pub/wordnet/bugfixes/ + +I also modified the groupexc function to fix the problem documented in + ftp://ftp.cogsci.princeton.edu/pub/wordnet/README.bugs +(buf[8] vs. buf[9] -- point 5 at the bottom) and modified it to avoid +allocating 1Kb from the stack and needlessly strcpy the argument given. +Nothing gets written into the string anyway, and we can examine it +without making a duplicate copy. -mi + --- src/lib/search.c Fri Nov 7 11:27:45 1997 +++ src/lib/search.c Fri Aug 7 12:57:08 1998 @@ -19,3 +19,3 @@ @@ -18,6 +29,27 @@ - getsearchsense(cursyn, synptr->pto[i])); + cursyn->wnsns[synptr->pto[i] - 1]); printsynset(prefix, cursyn, tbuf, DEFOFF, synptr->pto[i], +@@ -1405,16 +1405,15 @@ + + static int groupexc(unsigned long off1, unsigned long off2) + { +- char buf[8], *p, linebuf[1024]; ++ char buf[9], *p, *line; + + sprintf(buf, "%8.8lu", (off1 < off2 ? off1 : off2)); + + if ((p = bin_search(buf, cousinexcfp)) != NULL) { + sprintf(buf, "%8.8lu", (off2 > off1 ? off2 : off1)); +- strcpy(linebuf, p + 9); /* don't copy key */ +- linebuf[strlen(linebuf) - 1] = '\0'; /* strip off newline */ +- p = strtok(linebuf, " "); +- while (p && strcmp(p, buf)) ++ line = p + 9; /* ignore the key */ ++ p = strtok(line, " "); ++ while (p && strncmp(p, buf, 8)) + p = strtok(NULL, " "); + } + return(p ? 1 : 0); @@ -1775,2 +1780,8 @@ wnresults.numforms++; + |