]> git.pld-linux.org Git - packages/galeon.git/blob - galeon-history-xml.patch
- updated to galeon-1.3.9-20031025
[packages/galeon.git] / galeon-history-xml.patch
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
4 @@ -171,8 +171,8 @@
5  static char *
6  xml_decode_entity (const unsigned char *encoded)
7  {
8 -       gchar *buffer;
9 -       gint i, j, length;
10 +       char *buffer;
11 +       char *src, *dst;
12         
13         if (encoded == NULL)
14         {
15 @@ -183,54 +183,53 @@
16  
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)
21         {
22                 return buffer;
23         }
24 -       
25 -       length = strlen (buffer);
26 -       for (j = i; i < length; i++)
27 +
28 +       for (dst = src; *src != '\0'; src++)
29         {
30 -               if (encoded[i] == '&')
31 +               if (*src == '&')
32                 {
33 -                       if (strncmp (encoded + i + 1, "amp;", 4) == 0)
34 +                       if (strncmp (src + 1, "amp;", 4) == 0)
35                         {
36 -                               buffer[j++] = '&';
37 -                               i += 4;
38 +                               *dst++ = '&';
39 +                               src += 4;
40                         }
41 -                       else if (strncmp (encoded + i + 1, "lt;", 3) == 0)
42 +                       else if (strncmp (src + 1, "lt;", 3) == 0)
43                         {
44 -                               buffer[j++] = '<';
45 -                               i += 3;
46 +                               *dst++ = '<';
47 +                               src += 3;
48                         }
49 -                       else if (strncmp (encoded + i + 1, "gt;", 3) == 0)
50 +                       else if (strncmp (src + 1, "gt;", 3) == 0)
51                         {
52 -                               buffer[j++] = '>';
53 -                               i += 3;
54 +                               *dst++ = '>';
55 +                               src += 3;
56                         }
57 -                       else if (strncmp (encoded + i + 1, "quot;", 5) == 0)
58 +                       else if (strncmp (src + 1, "quot;", 5) == 0)
59                         {
60 -                               buffer[j++] = '"';
61 -                               i += 5;
62 +                               *dst++ = '"';
63 +                               src += 5;
64                         }
65 -                       else if (strncmp (encoded + i + 1, "apos;", 5) == 0)
66 +                       else if (strncmp (src + 1, "apos;", 5) == 0)
67                         {
68 -                               buffer[j++] = '\'';
69 -                               i += 5;
70 +                               *dst++ = '\'';
71 +                               src += 5;
72                         }
73 -                       else if (encoded[i + 1] == '#')
74 +                       else if (src[1] == '#')
75                         {
76 -                               buffer[j++] = atoi (encoded + i + 2);
77 -                               i += 5;
78 +                               *dst++ = atoi (src + 2);
79 +                               src += 5;
80                         }
81                 }
82                 else
83                 {
84 -                       buffer[j++] = encoded[i];
85 +                       *dst++ = *src;
86                 }
87         }
88  
89 -       buffer[j] = '\0';
90 +       *dst++ = '\0';
91         return buffer;
92  }
93                                 
This page took 0.042838 seconds and 3 git commands to generate.