Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 25101 - urlview adds newline at the end of string passed to url_handler.sh and this breaks functionality when launching a text browser
Summary: urlview adds newline at the end of string passed to url_handler.sh and this b...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High minor
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-23 00:48 UTC by BlueRaven
Modified: 2003-10-18 18:05 UTC (History)
1 user (show)

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


Attachments
The test file I used (test.txt,77 bytes, text/plain)
2003-07-23 00:50 UTC, BlueRaven
Details
Fixes newline-ignorant regex. (no-trailing-newline.patch,527 bytes, patch)
2003-09-06 03:12 UTC, James Harlow (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BlueRaven 2003-07-23 00:48:02 UTC
This is the stable version of urlview I'm currently using:

blue@mythdrannor blue $ emerge -s urlview
Searching...   
[ Results for search key : urlview ]
[ Applications found : 1 ]
 
*  net-misc/urlview
      Latest version available: 0.9
      Latest version installed: 0.9
      Size of downloaded files: 45 kB
      Homepage:    http://www.mutt.org
      Description: extracts urls from text and will send them to another app


blue@mythdrannor blue $ 

Everytime I call it from inside of mutt or as an independent helper program, my
browser starts but it often tells me that page does not exist or shows no output
at all.
I tested it with lynx 2.8.4.1c, links 2.1_pre9 and elinks 0.4.2.
I didn't test it with a graphical browser, so I can't tell if it behaves correctly.
Problem seems to be an extra newline added by urlview to the string passed to
url_handler.sh. This is taken from urlview launched in an xterm (I wasn't able
to see it in console):

blue@mythdrannor blue $ urlview test.txt 
Executing: url_handler.sh
'http://www.reuters.com/newsArticle.jhtml?type=technologyNews&storyID=3095377
'...
blue@mythdrannor blue $ cat test.txt | urlview
Executing: url_handler.sh
'http://www.reuters.com/newsArticle.jhtml?type=technologyNews&storyID=3095377
'...
blue@mythdrannor blue $

As you can see, there's an extra newline character at the end of the string.
I'm quite sure this is the problem, because if I try to hit backspace before
pressing Enter to launch browser the final '7' digit doesn't get cancelled and
everything works fine.
Comment 1 BlueRaven 2003-07-23 00:50:31 UTC
Created attachment 14898 [details]
The test file I used

Use this to reproduce the behaviour I described
Comment 2 James Harlow (RETIRED) gentoo-dev 2003-09-06 03:12:32 UTC
Created attachment 17143 [details, diff]
Fixes newline-ignorant regex.

If the line in the text file ends with a URL, the newline at the end is
included in the processed URL. This patch fixes the URL that matches the
newline.
Comment 3 Martin Larsen 2003-09-19 00:43:24 UTC
YEEEEEEEEEES! Thank you, thank you, thank you. :-) 
Comment 4 Martin Holzer (RETIRED) gentoo-dev 2003-09-24 12:27:32 UTC
did you send this upstream ?
Comment 5 James Harlow (RETIRED) gentoo-dev 2003-09-24 15:20:21 UTC
I thought I had but I just checked, and I hadn't. Done now. 
Comment 6 Markus Nigbur (RETIRED) gentoo-dev 2003-10-18 18:05:49 UTC
I included the patch, because urlview was last updated in 2000 and the previous
version was released 1998.