From 4d7b44ec0a265a7f6025f858b7943403f2607464 Mon Sep 17 00:00:00 2001 From: Alfons Hoogervorst Date: Sun, 4 Nov 2001 16:13:43 +0000 Subject: [PATCH] fix bug in textview introduced by enhanced clickable links --- ChangeLog.claws | 7 ++++++- configure.in | 2 +- src/textview.c | 13 +++++++++---- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index 09e86790c..08469aae8 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -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" diff --git a/configure.in b/configure.in index 535ff65ff..77ab6ba3b 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/src/textview.c b/src/textview.c index f0e7f4253..1e0c51631 100644 --- a/src/textview.c +++ b/src/textview.c @@ -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 , 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); -- 2.25.1