After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 170364 - open link doesn't include last /
open link doesn't include last /
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
list-kmaraas
: 309476 323734 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-03-14 19:27 UTC by Toni Willberg
Modified: 2006-07-05 23:10 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
Regular expressions updated (1.45 KB, patch)
2005-04-04 03:08 UTC, Samuel Abels
needs-work Details | Review
Do s/nttp/nntp/ on patch from Samuel Abels (1.45 KB, patch)
2005-07-01 23:56 UTC, Olav Vitters
committed Details | Review

Description Toni Willberg 2005-03-14 19:27:14 UTC
Distribution/Version: Debian Testing

1) find text in your gnome-terminal, like the following:
http://www.cars.auto.ru/sale/SF59881/448506/
2) right-click on the link
3) select Open Link form the menu

Notice that gnome-terminal doesn't hilight nor include the trailing / in the
opened URL, causing "page not found" or similar error (in case the server treats
URLs with  trailing /'s and without differently).
Comment 1 Olav Vitters 2005-04-02 19:53:32 UTC
This bug is caused by the regexp used by gnome-terminal. The regexp should be
changed to include the last slash.

Regexp is defined in src/terminal-screen.c starting with line 242.

Adding gnome-love. Note that maintainer is not really around.
Comment 2 Samuel Abels 2005-04-03 23:37:27 UTC
The relevant line is this:

 "(/[-A-Za-z0-9_$.+!*(),;:@&=?/~#%]*[^]'.}>) \t\r\n,\\\"])?\\>", FLAVOR_AS_IS);

This should represent the "path" part of the URL.
Chopped down into simpler pieces this becomes...

- Starts with a slash
 "(/

- Followed by 0-unlimited path characters, including slashes.
[-A-Za-z0-9_$.+!*(),;:@&=?/~#%]*

- Followed by exacly one character that does NOT match any brackets, newlines,
whitespace, dots, commas, quotes and backslashes. Meaning, the "forward" slash
*should* match. Definitely strange behavior.
[^]'.}>) \t\r\n,\\\"]

- The path is optional. 
)?\\>"

In other words, I believe the regular expression is correct and the problem is
elsewhere to be found. gnome-terminal uses vte's regexp support, I tracked it
down into vte/vte.c, presumably that is closer to the source of the problem.
Comment 3 Olav Vitters 2005-04-03 23:49:12 UTC
It is caused by the \\>

(match empty string at end of word.. but / is not a word)
Comment 4 Samuel Abels 2005-04-04 03:08:13 UTC
Created attachment 39662 [details] [review]
Regular expressions updated

Sorry for the mistake.

I am not sure why "empty string at end of word" was added in the first place,
since "...]*" is "greedy" anyway, so it should actually always grab the
complete URL. (Maybe that is a regexp engine portability issue?)

I removed that and also removed some redundancy. Compiled using gcc/glibc and
tested on several hundred URLs (with and without trailing slashes both), all
seems to work fine.
Comment 5 Kjartan Maraas 2005-07-01 23:47:41 UTC
Doesn't apply any more it seems. And why is PATHCHARS introduced and not used?
Comment 6 Olav Vitters 2005-07-01 23:56:33 UTC
Created attachment 48528 [details] [review]
Do s/nttp/nntp/ on patch from Samuel Abels

PATHCHARS is used within URLPATH (probably to simplify things).

The nntp fix broke this patch, did a s/nttp/nntp/g, applies cleanly now.
Comment 7 Olav Vitters 2005-07-01 23:57:41 UTC
Comment on attachment 48528 [details] [review]
Do s/nttp/nntp/ on patch from Samuel Abels

Comment 6: s/Toni Willberg/Samuel Abels/
Comment 8 Kjartan Maraas 2005-07-02 00:39:01 UTC
Thanks. Commiting.
Comment 9 Olav Vitters 2005-07-04 20:37:58 UTC
*** Bug 309476 has been marked as a duplicate of this bug. ***
Comment 10 Olav Vitters 2005-12-10 16:19:54 UTC
*** Bug 323734 has been marked as a duplicate of this bug. ***
Comment 11 Alex Lancaster 2006-02-17 19:26:49 UTC
Patch was committed, update status.
Comment 12 Alex Lancaster 2006-07-05 22:25:27 UTC
Seems to be a regression, I can't get this to work in recent gnome-terminal.  Won't recognise trailing "/", e.g. try pasting:

http://www.tei-c.org.uk/Software/passivetex/

into the gnome-terminal window, then right click on "Open Link", only:

http://www.tei-c.org.uk/Software/passivetex

gets passed to the brower.

This is with gnome-terminal-2.14.2-1 on Fedora Core 5.  Re-opening bug.
Comment 13 Olav Vitters 2006-07-05 22:32:47 UTC
That was filed and differently in bug 329003... seems it wasn't fixed in 2.14 branch but only in 2.15 one.

Remarking fixed as this is the wrong bug.
Comment 14 Alex Lancaster 2006-07-05 22:38:01 UTC
This should be marked as a DUPLICATE, or INVALID in that case, shouldn't it?  

Otherwise it looks like the bug was fixed by the patch below, which it wasn't.
Comment 15 Olav Vitters 2006-07-05 22:45:26 UTC
Why? It was fixed, but regressed some time after. For regressions you can either reopen the old bug, or open a new one. I opened a new one because it broke a few months after the previous patch fixed it.

And yes it was fixed by below patch, I tested the change. Then regressed by another change.

Perhaps I should better have mentioned the new bug here or reopened it...
Comment 16 Alex Lancaster 2006-07-05 22:56:31 UTC
OK, but what caused the regression, by the way?
Comment 17 Olav Vitters 2006-07-05 23:10:09 UTC
I assumed (but did not test) that it was caused by bug 324246.