2004-09-29 [paul] 0.9.12cvs113
authorPaul Mangan <paul@claws-mail.org>
Wed, 29 Sep 2004 08:38:57 +0000 (08:38 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 29 Sep 2004 08:38:57 +0000 (08:38 +0000)
* src/quote_fmt_parse.y
In the quotation templates recognise sender's first and last
names (%F %L) when the name is in the format "Duck, Donald".
Patch submitted by Thomas Gilgin, <thomas_gilgin@users.sourceforge.net>

ChangeLog.claws
PATCHSETS
configure.ac
src/quote_fmt_parse.y

index 2343913..7edcd8a 100644 (file)
@@ -1,3 +1,11 @@
+2004-09-29 [paul]      0.9.12cvs113
+
+       * src/quote_fmt_parse.y
+               In the quotation templates recognise sender's first and last 
+               names (%F %L) when the name is in the format "Duck, Donald".
+               Patch submitted by Thomas Gilgin, <thomas_gilgin@users.sourceforge.net>
+
+
 2004-09-28 [colin]     0.9.12cvs112
 
        * src/mainwindow.c
index e4b2c1e..7ce4a39 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
@@ -95,3 +95,4 @@
 ( cvs diff -u -r 1.246 -r 1.247 src/folderview.c; cvs diff -u -r 1.307 -r 1.308 src/mainwindow.c; ) > 0.9.12cvs110.patchset
 ( cvs diff -u -r 1.308 -r 1.309 src/mainwindow.c; ) > 0.9.12cvs111.patchset
 ( cvs diff -u -r 1.309 -r 1.310 src/mainwindow.c; cvs diff -u -r 1.247 -r 1.248 src/folderview.c; ) > 0.9.12cvs112.patchset
+( cvs diff -u -r 1.24 -r 1.25 src/quote_fmt_parse.y; ) > 0.9.12cvs113.patchset
index 08b481e..faf18d2 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=112
+EXTRA_VERSION=113
 EXTRA_RELEASE=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
index 722c69e..a4afabe 100644 (file)
@@ -296,13 +296,26 @@ special:
                        guchar *p;
                        gchar *str;
 
-                       str = alloca(strlen(msginfo->fromname) + 1);
-                       if (str != NULL) {
-                               strcpy(str, msginfo->fromname);
-                               p = str;
-                               while (*p && !isspace(*p)) p++;
-                               *p = '\0';
-                               INSERT(str);
+                       p = strchr(msginfo->fromname, ',');
+                       if (p != NULL) {
+                               /* fromname is like "Duck, Donald" */
+                               p++;
+                               while (*p && isspace(*p)) p++;
+                               str = alloca(strlen(p) + 1);
+                               if (str != NULL) {
+                                       strcpy(str, p);
+                                       INSERT(str);
+                               }
+                       } else {
+                               /* fromname is like "Donald Duck" */
+                               str = alloca(strlen(msginfo->fromname) + 1);
+                               if (str != NULL) {
+                                       strcpy(str, msginfo->fromname);
+                                       p = str;
+                                       while (*p && !isspace(*p)) p++;
+                                       *p = '\0';
+                                       INSERT(str);
+                               }
                        }
                }
        }
@@ -317,22 +330,33 @@ special:
                        str = alloca(strlen(msginfo->fromname) + 1);
                        if (str != NULL) {
                                strcpy(str, msginfo->fromname);
-                                p = str;
-                                while (*p && !isspace(*p)) p++;
-                                if (*p) {
-                                   /* We found a space. Get first none-space char and
-                                    insert rest of string from there. */
-                                   while (*p && isspace(*p)) p++;
-                                    if (*p) {
-                                       INSERT(p);
-                                   } else {
-                                       /* If there is no none-space char, just insert
-                                        whole fromname. */
+                               p = strchr(str, ',');
+                               if (p != NULL) {
+                                       /* fromname is like "Duck, Donald" */
+                                       *p = '\0';
                                        INSERT(str);
-                                   }
                                } else {
-                                   /* If there is no space, just insert whole fromname. */
-                                   INSERT(str);
+                                       /* fromname is like "Donald Duck" */
+                                       p = str;
+                                       while (*p && !isspace(*p)) p++;
+                                       if (*p) {
+                                           /* We found a space. Get first 
+                                            none-space char and insert
+                                            rest of string from there. */
+                                           while (*p && isspace(*p)) p++;
+                                           if (*p) {
+                                               INSERT(p);
+                                           } else {
+                                               /* If there is no none-space 
+                                                char, just insert whole 
+                                                fromname. */
+                                               INSERT(str);
+                                           }
+                                       } else {
+                                           /* If there is no space, just 
+                                            insert whole fromname. */
+                                           INSERT(str);
+                                       }
                                }
                        }
                }