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 aa18f0c..c09b287 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]
 2001-11-04 [alfons]    0.6.4claws24
 
        * src/utils.[ch]
index 77ab6ba..37422cf 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=4
 INTERFACE_AGE=0
 BINARY_AGE=0
 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
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index 58def02..3ce8e24 100644 (file)
@@ -2083,8 +2083,7 @@ static void summary_set_header(SummaryView *summaryview, gchar *text[],
            !MSG_IS_NEWS(msginfo->flags)) {
                gchar *from;
 
            !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);
                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;
   
                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);
                extract_address(from);
                if (*from) {
                        count = complete_address(from);
index 3cd76d3..b647739 100644 (file)
@@ -653,10 +653,15 @@ void eliminate_quote(gchar *str, gchar quote_chr)
 
 void extract_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 ((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);
                }
                        *p = '\0';
                        memmove(str, str + 1, p - str);
                }