Commits

tm512 committed 714da13

Loop to ensure that we convert all HTML character codes of a particular type, not just the first one.

Comments (0)

Files changed (1)

src/modules/linktitle/main.c

 void convertchars (char *c)
 {
 	int i;
+	char *d, *e;
 	for (i = 0; htmlchar [i].code; i++)
 	{
-		char *d = strstr (c, htmlchar [i].code), *e;
-
-		if (!d)
-			continue;
+		while ((d = strstr (c, htmlchar [i].code)))
+		{
+			if (!d)
+				continue;
 
-		e = strstr (d, ";") + 1;
+			e = strstr (d, ";") + 1;
 
-		strcpy (d, htmlchar [i].ch);
-		d += strlen (htmlchar [i].ch);
+			strcpy (d, htmlchar [i].ch);
+			d += strlen (htmlchar [i].ch);
 
-		// In-place copy
-		while (*e)
-			*(d++) = *(e++);
-		*d = '\0';
+			// In-place copy
+			while (*e)
+				*(d++) = *(e++);
+			*d = '\0';
+		}
 	}
 
 	return;