1 diff -Nuard galeon-1.3.9.orig/embed/global-history.c galeon-1.3.9/embed/global-history.c
2 --- galeon-1.3.9.orig/embed/global-history.c 2003-09-06 00:58:46.000000000 +0200
3 +++ galeon-1.3.9/embed/global-history.c 2003-09-16 23:13:42.000000000 +0200
6 xml_decode_entity (const unsigned char *encoded)
17 /* Optimize for case where no escape codes are found, otherwise
18 * use the first found code as the starting index */
19 - if ((i = (char *) strstr (buffer, "&") - buffer) < 0)
20 + if ((src = strchr (buffer, '&')) == NULL)
25 - length = strlen (buffer);
26 - for (j = i; i < length; i++)
28 + for (dst = src; *src != '\0'; src++)
30 - if (encoded[i] == '&')
33 - if (strncmp (encoded + i + 1, "amp;", 4) == 0)
34 + if (strncmp (src + 1, "amp;", 4) == 0)
41 - else if (strncmp (encoded + i + 1, "lt;", 3) == 0)
42 + else if (strncmp (src + 1, "lt;", 3) == 0)
49 - else if (strncmp (encoded + i + 1, "gt;", 3) == 0)
50 + else if (strncmp (src + 1, "gt;", 3) == 0)
57 - else if (strncmp (encoded + i + 1, "quot;", 5) == 0)
58 + else if (strncmp (src + 1, "quot;", 5) == 0)
65 - else if (strncmp (encoded + i + 1, "apos;", 5) == 0)
66 + else if (strncmp (src + 1, "apos;", 5) == 0)
73 - else if (encoded[i + 1] == '#')
74 + else if (src[1] == '#')
76 - buffer[j++] = atoi (encoded + i + 2);
78 + *dst++ = atoi (src + 2);
84 - buffer[j++] = encoded[i];