replace Xalloca + strdup with Xstrdup_a
authorChristoph Hohmann <reboot@gmx.ch>
Sun, 4 Nov 2001 20:00:11 +0000 (20:00 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Sun, 4 Nov 2001 20:00:11 +0000 (20:00 +0000)
better implementation of extracting quoted names from addresses (remove backlashes and ignore quotes after them)

ChangeLog.claws
configure.in
src/summaryview.c
src/utils.c

index aa18f0c0da8f40110b8b76ededa1b1cfd4387cb9..c09b287ccdcdd8866251c114428d5f72f7829365 100644 (file)
@@ -1,3 +1,12 @@
+2001-11-04 [christoph] 0.6.4claws25
+
+       * src/summaryview.c
+               replace Xalloca + strdup with Xstrdup_a
+       * src/utils.c
+               better implementation of extracting quoted names
+               from addresses (remove backlashes and ignore
+               quotes after them)
+
 2001-11-04 [alfons]    0.6.4claws24
 
        * src/utils.[ch]
index 77ab6ba3bab0cb950a170c042e262301bfdb9d1e..37422cf42509073c3868606519cb0204a799649b 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=4
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws24
+EXTRA_VERSION=claws25
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index 58def0230f2c496105e59dc27555e7a8c793230c..3ce8e2439a224d5460435cad18575711a4e50bbc 100644 (file)
@@ -2083,8 +2083,7 @@ static void summary_set_header(SummaryView *summaryview, gchar *text[],
            !MSG_IS_NEWS(msginfo->flags)) {
                gchar *from;
 
-               Xalloca(from, strlen(msginfo->from) + 1, return);
-               strcpy(from, msginfo->from);
+               Xstrdup_a(from, msginfo->from, return);
                extract_address(from);
                if (account_find_from_address(from)) {
                        g_free(to);
@@ -2098,8 +2097,7 @@ static void summary_set_header(SummaryView *summaryview, gchar *text[],
                gint count;
                gchar *from;
   
-               Xalloca(from, strlen(msginfo->from) + 1, return);
-               strcpy(from, msginfo->from);
+               Xstrdup_a(from, msginfo->from, return);
                extract_address(from);
                if (*from) {
                        count = complete_address(from);
index 3cd76d3784fea0e511697224933dad86edcf4519..b647739478c3d5ac0db79649984bb4149d41d925 100644 (file)
@@ -653,10 +653,15 @@ void eliminate_quote(gchar *str, gchar quote_chr)
 
 void extract_quote(gchar *str, gchar quote_chr)
 {
-       register gchar *p;
+       register gchar *p, *p2;
 
        if ((str = strchr(str, quote_chr))) {
-               if ((p = strchr(str + 1, quote_chr))) {
+               p2 = str;
+               while ((p = strchr(p2 + 1, quote_chr)) && (p[-1] == '\\')) {
+                       memmove(p - 1, p, strlen(p) + 1);
+                       p2 = p - 1;
+               }
+               if(p) {
                        *p = '\0';
                        memmove(str, str + 1, p - str);
                }