]> git.pld-linux.org Git - packages/galeon.git/commitdiff
- http://bugzilla.gnome.org/show_bug.cgi?id=122414, fix reading history.xml file
authorMarcin Krzyżanowski <marcin.krzyzanowski@hakore.com>
Tue, 16 Sep 2003 21:15:19 +0000 (21:15 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    galeon-history-xml.patch -> 1.1

galeon-history-xml.patch [new file with mode: 0644]

diff --git a/galeon-history-xml.patch b/galeon-history-xml.patch
new file mode 100644 (file)
index 0000000..89fa705
--- /dev/null
@@ -0,0 +1,93 @@
+diff -Nuard galeon-1.3.9.orig/embed/global-history.c galeon-1.3.9/embed/global-history.c
+--- galeon-1.3.9.orig/embed/global-history.c   2003-09-06 00:58:46.000000000 +0200
++++ galeon-1.3.9/embed/global-history.c        2003-09-16 23:13:42.000000000 +0200
+@@ -171,8 +171,8 @@
+ static char *
+ xml_decode_entity (const unsigned char *encoded)
+ {
+-      gchar *buffer;
+-      gint i, j, length;
++      char *buffer;
++      char *src, *dst;
+       
+       if (encoded == NULL)
+       {
+@@ -183,54 +183,53 @@
+       /* Optimize for case where no escape codes are found, otherwise
+        * use the first found code as the starting index */
+-      if ((i = (char *) strstr (buffer, "&") - buffer) < 0)
++      if ((src = strchr (buffer, '&')) == NULL)
+       {
+               return buffer;
+       }
+-      
+-      length = strlen (buffer);
+-      for (j = i; i < length; i++)
++
++      for (dst = src; *src != '\0'; src++)
+       {
+-              if (encoded[i] == '&')
++              if (*src == '&')
+               {
+-                      if (strncmp (encoded + i + 1, "amp;", 4) == 0)
++                      if (strncmp (src + 1, "amp;", 4) == 0)
+                       {
+-                              buffer[j++] = '&';
+-                              i += 4;
++                              *dst++ = '&';
++                              src += 4;
+                       }
+-                      else if (strncmp (encoded + i + 1, "lt;", 3) == 0)
++                      else if (strncmp (src + 1, "lt;", 3) == 0)
+                       {
+-                              buffer[j++] = '<';
+-                              i += 3;
++                              *dst++ = '<';
++                              src += 3;
+                       }
+-                      else if (strncmp (encoded + i + 1, "gt;", 3) == 0)
++                      else if (strncmp (src + 1, "gt;", 3) == 0)
+                       {
+-                              buffer[j++] = '>';
+-                              i += 3;
++                              *dst++ = '>';
++                              src += 3;
+                       }
+-                      else if (strncmp (encoded + i + 1, "quot;", 5) == 0)
++                      else if (strncmp (src + 1, "quot;", 5) == 0)
+                       {
+-                              buffer[j++] = '"';
+-                              i += 5;
++                              *dst++ = '"';
++                              src += 5;
+                       }
+-                      else if (strncmp (encoded + i + 1, "apos;", 5) == 0)
++                      else if (strncmp (src + 1, "apos;", 5) == 0)
+                       {
+-                              buffer[j++] = '\'';
+-                              i += 5;
++                              *dst++ = '\'';
++                              src += 5;
+                       }
+-                      else if (encoded[i + 1] == '#')
++                      else if (src[1] == '#')
+                       {
+-                              buffer[j++] = atoi (encoded + i + 2);
+-                              i += 5;
++                              *dst++ = atoi (src + 2);
++                              src += 5;
+                       }
+               }
+               else
+               {
+-                      buffer[j++] = encoded[i];
++                      *dst++ = *src;
+               }
+       }
+-      buffer[j] = '\0';
++      *dst++ = '\0';
+       return buffer;
+ }
+                               
This page took 0.195335 seconds and 4 git commands to generate.