! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
terminal copies incorrect url if missed tailing '/'
Status:
RESOLVED: FIXED
Product:
Xfce4-terminal
Component:
General

Comments

Description Ikonta 2011-09-06 08:41:57 CEST
XFce Terminal suggests to copy url into memory buffer.

If source string looks like:
<a>http://ya.ru/</a>
operation is correct.

But if url doesn't contain tailing '/', terminal copies +1 symbol (doesn't check close tag?).
I.e. if the source string is:
<a>http://ya.ru</a>
In the memory buffer is copied (and pasted) incorrect url string:
'http://ya.ru<'

P.S. If trying to copy url from href argument of 'a' tag both cases (i.e. present and missed tailing '/') works correctly.
Comment 1 Jeff Shipley 2013-07-22 19:47:43 CEST
URL recognition seems to have a few problems (and seems to work mostly the same as gnome-terminal which isn't surprising since it looks like both applications use nearly identical regexes to match).

The opening character of a pair ('(', '<', '{', and '[') get added to the URL but terminate the URL. The exception to this is when they directly follow a '/' (not necessarily tailing, "http://www.foo.com/(whatisthis/more" would be recognized as "http://www.foo.com/"). This causes problems for wikipedia style links with '(' and ')' in them (https://bugzilla.xfce.org/show_bug.cgi?id=9800). The closing character of the pair does not get recognized as part of the URL.

Actually, it looks like any single character following a slash will be ignored.

http://www.foo.com/a matches http://www.foo.com/
http://www.foo.com/ab matches http://www.foo.com/ab

If the current regex can't be easily fixed, it may be worth looking into http://daringfireball.net/2010/07/improved_regex_for_matching_urls as a replacement.

I'm going to spend some time with this, and see if I can come up with a good patch.
Comment 2 Natanael Copa 2013-07-23 09:30:00 CEST
Created attachment 5099 
Patch from dev mailing list

this is the patch Jeff sent to mailing list.

It also fixes bug #9800 but I post it only here.
Comment 3 Jeff Shipley 2013-07-23 21:28:10 CEST
Created attachment 5100 
patch without duplicate USERS define

I recreated the above patch as it duplicated the "#define USERS" line instead of just changing it.
Comment 4 Nick Schermer editbugs 2013-07-25 13:00:30 CEST
*** Bug 9800 has been marked as a duplicate of this bug. ***
Comment 5 Nick Schermer editbugs 2013-07-25 13:04:26 CEST
Pushed in 2e1c325. Thanks.

Bug #7959

Reported by:
Ikonta
Reported on: 2011-09-06
Last modified on: 2013-07-25
Duplicates (1):
  • 9800 url's with ( in them aren't selected right

People

Assignee:
Nick Schermer
CC List:
4 users

Version

Attachments

Patch from dev mailing list (2.34 KB, patch)
2013-07-23 09:30 CEST , Natanael Copa
no flags
patch without duplicate USERS define (2.29 KB, patch)
2013-07-23 21:28 CEST , Jeff Shipley
no flags

Additional information