Reporter: Warren Jones Tue Mar 26 17:28:31 1996 Problem: If SWISH encounters an HTML escape sequence that doesn't have the required semicolon as a terminator, it will go into endless recursion in converttoascii(). The example that bit me was ""e;" (a misspelling of """). hasnonascii() mistakenly reports that the string contains an escape sequence, because it's not looking for the closing semicolon. converttoascii() fails to remove the escape sequence. Round and round ... Solution: Make hasnonascii() check for the closing semicolon. There are probably more elegant solutions. Note: Compare this with swish-patch-05, which appears to use another method to solve the same problem. Index: string.c =================================================================== RCS file: /usr0/wjones/src/CVS.repo/swish/src/string.c,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 string.c *** string.c 1995/10/18 18:43:29 1.1.1.1 --- string.c 1995/10/20 23:47:26 *************** *** 484,497 **** char *s; { int i; ! char *c, *d; for (i = 0; entities[i] != NULL; i += 3) { c = d = NULL; if ((entities[i])[0] != '\0') ! c = (char *) strstr(s, entities[i]); if ((entities[i + 1])[0] != '\0') ! d = (char *) strstr(s, entities[i + 1]); if ((entities[i + 2])[0] != '\0') if (c != NULL || d != NULL) return 1; --- 484,501 ---- char *s; { int i; ! char *c, *d, wrdent[MAXENTLEN], nument[MAXENTLEN]; for (i = 0; entities[i] != NULL; i += 3) { + + sprintf(wrdent, "%s;", entities[i]); + sprintf(nument, "%s;", entities[i + 1]); + c = d = NULL; if ((entities[i])[0] != '\0') ! c = (char *) strstr(s, wrdent); if ((entities[i + 1])[0] != '\0') ! d = (char *) strstr(s, nument); if ((entities[i + 2])[0] != '\0') if (c != NULL || d != NULL) return 1;