From ae63d6eb052d128e4195902d927769fd6d56ce9e Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 21 Apr 2008 19:40:56 +0000 Subject: =?UTF-8?q?Add=20support=20for=20apt://=20URLS.=20Fixes=20bug=20#5?= =?UTF-8?q?29049=20(Ga=C3=ABtan=20Podevijn).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=1028 --- libempathy/empathy-utils.c | 5 +++++ libempathy/empathy-utils.h | 1 + 2 files changed, 6 insertions(+) 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, -- cgit v1.2.3