aboutsummaryrefslogtreecommitdiffstats
path: root/main/xfce4-terminal
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-07-24 07:54:08 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-07-24 07:54:08 +0000
commita2767704007eaf277cd153e9e3ea42d213e0335e (patch)
treebdae2a3b3962b830ae68bf96d33a495c4bdd3335 /main/xfce4-terminal
parent6b4992cfccb3fe3e59a82f32de6b45075e72d63c (diff)
downloadaports-a2767704007eaf277cd153e9e3ea42d213e0335e.tar.bz2
aports-a2767704007eaf277cd153e9e3ea42d213e0335e.tar.xz
main/xfce4-terminal: add improved url matching patch
from bugzilla: https://bugzilla.xfce.org/show_bug.cgi?id=7959
Diffstat (limited to 'main/xfce4-terminal')
-rw-r--r--main/xfce4-terminal/Improve-URL-matching.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/main/xfce4-terminal/Improve-URL-matching.patch b/main/xfce4-terminal/Improve-URL-matching.patch
new file mode 100644
index 0000000000..619fb2df8e
--- /dev/null
+++ b/main/xfce4-terminal/Improve-URL-matching.patch
@@ -0,0 +1,52 @@
+From 52fcc3e27927e7f730b836c9a9cc90791b792b8c Mon Sep 17 00:00:00 2001
+From: Jeff Shipley <jshipley@fastmail.fm>
+Date: Tue, 23 Jul 2013 13:20:42 -0600
+Subject: [PATCH] Improve URL matching
+
+- Add support for matching IPv6 addresses
+- Fix URL parsing (bug #7959 and bug #9800)
+- Add some characters for email address parsing
+---
+ terminal/terminal-widget.c | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/terminal/terminal-widget.c b/terminal/terminal-widget.c
+index d490994..5a7d266 100644
+--- a/terminal/terminal-widget.c
++++ b/terminal/terminal-widget.c
+@@ -40,17 +40,19 @@
+
+
+
+-#define USERCHARS "-_+[:alnum:]"
++#define USERCHARS "-[:alnum:]\\Q_.+\\E"
+ #define USERCHARS_CLASS "[" USERCHARS "]"
+ #define PASSCHARS_CLASS "[-[:alnum:]\\Q,?;.:/!%$^*&~\"#'\\E]"
+ #define HOSTCHARS_CLASS "[-[:alnum:]]"
+-#define HOST HOSTCHARS_CLASS "+(\\." HOSTCHARS_CLASS "+)*"
++#define HOSTNAME HOSTCHARS_CLASS "+(?:\\." HOSTCHARS_CLASS "+)*"
++#define IPV6ADDRESS "\\[(?:[[:xdigit:]]{0,4}:){2,7}[[:xdigit:]]{0,4}\\]"
++#define HOST "(?:" HOSTNAME "|" IPV6ADDRESS ")"
+ #define PORT "(?:\\:[[:digit:]]{1,5})?"
+ #define PATHCHARS_CLASS "[-[:alnum:]\\Q_$.+!*,;@&=?/:~#'%\\E]"
+-#define PATHTERM_CLASS "[^\\Q]'.}>) \t\r\n,\"\\E]"
++#define PATHTERM_CLASS "[[:alnum:]\\Q_$+*@&=/~#%\\E]"
+ #define SCHEME "(?:news:|telnet:|nntp:|file:\\/|https?:|ftps?:|sftp:|webcal:|magnet:)"
+ #define USERPASS USERCHARS_CLASS "+(?:" PASSCHARS_CLASS "+)?"
+-#define URLPATH "(?:(/"PATHCHARS_CLASS"+(?:[(]"PATHCHARS_CLASS"*[)])*"PATHCHARS_CLASS"*)*"PATHTERM_CLASS")?"
++#define URLPATH "(?:(?:\\(" PATHCHARS_CLASS "*\\)|" PATHCHARS_CLASS ")*(?:\\(" PATHCHARS_CLASS "*\\)|" PATHTERM_CLASS "))?"
+
+
+
+@@ -78,7 +80,7 @@ TerminalRegexPattern;
+ static const TerminalRegexPattern regex_patterns[] =
+ {
+ { SCHEME "//(?:" USERPASS "\\@)?" HOST PORT URLPATH, PATTERN_TYPE_FULL_HTTP },
+- { "(?:www|ftp)" HOSTCHARS_CLASS "*\\." HOST PORT URLPATH, PATTERN_TYPE_HTTP },
++ { "(?:www[[:digit:]]{0,3}|ftp)" HOSTCHARS_CLASS "*\\." HOST PORT URLPATH, PATTERN_TYPE_HTTP },
+ { "(?:mailto:)?" USERCHARS_CLASS "[" USERCHARS ".]*\\@" HOSTCHARS_CLASS "+\\." HOST, PATTERN_TYPE_EMAIL },
+ { "news:[[:alnum:]\\Q^_{|}~!\"#$%&'()*+,./;:=?`\\E]+", PATTERN_TYPE_FULL_HTTP }
+ };
+--
+1.8.1.2
+