Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 164976 - app-text/wv - hyperlinks are handled incorrectly if they have spaces
Summary: app-text/wv - hyperlinks are handled incorrectly if they have spaces
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo Linux Gnome Desktop Team
Depends on:
Reported: 2007-02-02 13:22 UTC by Dmitry Poltaryonok
Modified: 2010-03-13 18:13 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---

Patch which fixes bug (wv-1.2.3-links.patch,597 bytes, patch)
2007-02-02 13:24 UTC, Dmitry Poltaryonok
Details | Diff
Ebuild to use the patch (wv-1.2.3-r2.ebuild,1.19 KB, text/plain)
2007-02-02 13:27 UTC, Dmitry Poltaryonok

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Poltaryonok 2007-02-02 13:22:53 UTC
If I have MS Word document with hyperlink to C:\\Documents and Settings\somepath\somefile.pdf After running wvHtml I will get <a href="C:\\Documents"

Reproducible: Always

Steps to Reproduce:
1. Create word document with hyperlink to file/directory with spaces in its name (click hyper link in OpenOffice.Org or MS Word and enter if in linux file:///some/path<space>with<space>space/file.doc in MSWord in Windows hyperlink to file location in C:\\Documents and Settings\Your Profile\file.doc) save document as createdfile.doc
2. run wvHtml createdfile.doc result.html
3. find a href=" in result.html

Actual Results:  
hyperlink in resulting html <a href="C:\\Documents">

Expected Results:  
hyperlink in resulting html <a href="C:\\Documents and Settings\\MyProfile\file.doc">

wv 1.2.4 available and has the same bug
Patch available create by me:
--- wv-1.2.3.orig/field.c	2006-03-15 18:55:45.000000000 +0200
+++ wv-1.2.3/field.c	2007-02-02 14:10:02.000000000 +0200
@@ -325,7 +325,7 @@
 	  switch (s_Tokens[tokenIndex].m_type)
 	    case FC_HYPERLINK:
-		token = strtok (NULL, "\"\" ");
+		token = strtok (NULL, "\"\"");
 		printf ("<a href=\"%s\">", token);
 	    case FC_EMBED:
@@ -334,7 +334,7 @@
 	/*	printf ("<!--%s-->", token);
 	 */	break;
 	    case FC_PAGEREF:
-		token = strtok (NULL, "\"\" ");
+		token = strtok (NULL, "\"\"");
 		printf ("<a href=\"#%s\" %s>", token, xml_slash);
 	    case FC_EDITTIME:
Comment 1 Dmitry Poltaryonok 2007-02-02 13:24:39 UTC
Created attachment 108931 [details, diff]
Patch which fixes bug

removes space in strtok delimeters on hyperlinks
Comment 2 Dmitry Poltaryonok 2007-02-02 13:27:51 UTC
Created attachment 108932 [details]
Ebuild to use the patch

ebuild which uses the patch attached earlier
Comment 3 Dmitry Poltaryonok 2007-02-02 14:45:02 UTC
Small addition: if link contains spaces encoded %20 then href will be generated correctly (in case of OpenOffice usually is, and in MS Word also, but sometimes they do not mask spaces with %20 (in OpenOffice if you change %20 to <space> in link manually), in MS Word I don't know as I got .doc file from client).
Comment 4 Daniel Gryniewicz (RETIRED) gentoo-dev 2007-02-06 02:19:51 UTC
Could you submit this upstream (  I'd like to see their take on this, since I have zero experience with wv.
Comment 5 Dmitry Poltaryonok 2007-02-06 08:40:42 UTC
They don't maintain wv itself, they use only wv library and tell that package wv is no longer mainated/supported, buy i see that wv update ( was on October 26, 2006 (wv-1.2.4 release). I noticed that website was not updated long ago and show news only for March 2006.
Need to check how abiword converts files :), but i don't wont the abiword itself, I need converted only...
Comment 6 Dmitry Poltaryonok 2007-02-06 08:59:05 UTC
abiword --to=html has different output format from wv-1.2.3, wv-1.2.4 It's a lot of time for me to change software which has to be used today, so I will use unmaintained package, which is working fine :)
Comment 7 Daniel Gryniewicz (RETIRED) gentoo-dev 2007-02-06 16:38:05 UTC
So are you saying that 1.2.4 works?
Comment 8 Dmitry Poltaryonok 2007-02-06 18:05:30 UTC
No, i'm saying that my patch works for 1.2.3. And i'm using it. Not sure if patch will suit 1.2.4. I'm just telling that i'm using patched wv not the abiword.
Comment 9 Pacho Ramos gentoo-dev 2010-03-12 10:18:14 UTC
Still valid with 1.2.7 (just added to the tree) ?