aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-04-22 03:40:56 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-04-22 03:40:56 +0800
commitae63d6eb052d128e4195902d927769fd6d56ce9e (patch)
tree5b8ded96e1f9c71c9218e7ab1c7356fd803aa9d4 /libempathy
parent638822cddf39c04c746d2196f6738b6d06056a8a (diff)
downloadgsoc2013-empathy-ae63d6eb052d128e4195902d927769fd6d56ce9e.tar
gsoc2013-empathy-ae63d6eb052d128e4195902d927769fd6d56ce9e.tar.gz
gsoc2013-empathy-ae63d6eb052d128e4195902d927769fd6d56ce9e.tar.bz2
gsoc2013-empathy-ae63d6eb052d128e4195902d927769fd6d56ce9e.tar.lz
gsoc2013-empathy-ae63d6eb052d128e4195902d927769fd6d56ce9e.tar.xz
gsoc2013-empathy-ae63d6eb052d128e4195902d927769fd6d56ce9e.tar.zst
gsoc2013-empathy-ae63d6eb052d128e4195902d927769fd6d56ce9e.zip
Add support for apt:// URLS. Fixes bug #529049 (Gaƫtan Podevijn).
svn path=/trunk/; revision=1028
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-utils.c5
-rw-r--r--libempathy/empathy-utils.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index 9132cbfc9..2c7ce1de0 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -58,6 +58,7 @@ empathy_substring (const gchar *str,
/*
* Regular Expression code to match urls.
*/
+#define APTCHARS "-A-Za-z0-9,-."
#define USERCHARS "-A-Za-z0-9"
#define PASSCHARS "-A-Za-z0-9,?;.:/!%$^*&~\"#'"
#define HOSTCHARS "-A-Za-z0-9_"
@@ -91,6 +92,10 @@ regex_init (void)
"(www|ftp)[" HOSTCHARS "]*\\.[" HOSTCHARS ".]+"
"(:[0-9]+)?(" URLPATH ")?";
break;
+ case EMPATHY_REGEX_APT:
+ expression =
+ "apt://[" APTCHARS "]*";
+ break;
case EMPATHY_REGEX_EMAIL:
expression =
"(mailto:)?[a-z0-9][a-z0-9.-]*@[a-z0-9]"
diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h
index 5ebaac069..6aab7cf00 100644
--- a/libempathy/empathy-utils.h
+++ b/libempathy/empathy-utils.h
@@ -44,6 +44,7 @@ G_BEGIN_DECLS
typedef enum {
EMPATHY_REGEX_AS_IS,
EMPATHY_REGEX_BROWSER,
+ EMPATHY_REGEX_APT,
EMPATHY_REGEX_EMAIL,
EMPATHY_REGEX_OTHER,
EMPATHY_REGEX_ALL,