ayttm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ayttm-commits] CVS: ayttm/src smileys.c,1.12,1.13


From: Colin Leroy <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/src smileys.c,1.12,1.13
Date: Fri, 24 Jan 2003 11:38:22 -0500

Update of /cvsroot/ayttm/ayttm/src
In directory subversions:/tmp/cvs-serv29389/src

Modified Files:
        smileys.c 
Log Message:
fix (i hope) smileys with >< in their drawing


Index: smileys.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/smileys.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- smileys.c   24 Jan 2003 13:34:41 -0000      1.12
+++ smileys.c   24 Jan 2003 16:38:20 -0000      1.13
@@ -244,10 +244,28 @@
       protocol_smiley * ps=(protocol_smiley *)l->data;
       if(!strncmp(text+ipos, ps->text, strlen(ps->text)))
       {
+       char html_text[128];
+       int i = 0, j = 0;
         g_string_append(newstr, "<smiley name=\"");
         g_string_append(newstr, ps->name);
        g_string_append(newstr, "\" alt=\"");
-       g_string_append(newstr, ps->text);
+       while (ps->text[i] && j<123) {
+               if(ps->text[i]=='>') {
+                       html_text[j++]='&';
+                       html_text[j++]='g';
+                       html_text[j++]='t';
+                       html_text[j++]=';';
+               } else if (ps->text[i]=='<') {
+                       html_text[j++]='&';
+                       html_text[j++]='l';
+                       html_text[j++]='t';
+                       html_text[j++]=';';
+               } else 
+                       html_text[j++]=ps->text[i];
+               i++;
+       }
+       html_text[j]='\0';
+       g_string_append(newstr, html_text);
         g_string_append(newstr, "\">");
         ipos += strlen(ps->text);
         found=1;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]