fix bug in textview introduced by enhanced clickable links
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 4 Nov 2001 16:13:43 +0000 (16:13 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 4 Nov 2001 16:13:43 +0000 (16:13 +0000)
ChangeLog.claws
configure.in
src/textview.c

index 09e86790c51b4c0e74f595d1615bcf069e9c072d..08469aae85f1508782773571637d8a9589dce16b 100644 (file)
@@ -1,4 +1,9 @@
-2001-11-04 [alfons]
+2001-11-04 [alfons]    0.6.4claws24
+       
+       * src/textview.c
+               fix bug reported by Kim Schulz. introduced by the patch integrated
+               in 0.6.4claws15. the code did not check the return value of
+               the html parser.
 
        * AUTHORS
                add Jonathan Ware and close "[ #475955 ] Enhanced Mailto Patch"
index 535ff65ff3595fd8725a11eb514044d6d30bba86..77ab6ba3bab0cb950a170c042e262301bfdb9d1e 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=4
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws23
+EXTRA_VERSION=claws24
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index f0e7f4253ff7b7bb8b95caf8076bd947c8e80a2e..1e0c51631009b1f6ddbe059b33a6120cf25ed891 100644 (file)
@@ -433,10 +433,15 @@ static void textview_show_html(TextView *textview, FILE *fp,
                if (parser->state == HTML_HREF) {
                        /* first time : get and copy the URL */
                        if (url == NULL) {
-                               url = strdup(strtok(str, " "));
-                               /* the URL may (or not) be followed by the
-                                * referenced text */
-                               str = strtok(NULL, "");
+                               /* ALF - the sylpheed html parser returns an empty string,
+                                * if still inside an <a>, but already parsed past HREF */
+                               str = strtok(str, " ");
+                               if (str) { 
+                                       url = strdup(str);
+                                       /* the URL may (or not) be followed by the
+                                        * referenced text */
+                                       str = strtok(NULL, "");
+                               }       
                        }
                        if (str != NULL) {
                                textview_write_link(textview, url, str, NULL);