Add more URL schemes

weechat-hashes
Curtis McEnroe 2018-10-22 16:32:02 -04:00
parent 35fdcbc285
commit 1164db0ba8
No known key found for this signature in database
GPG Key ID: CEA2F97ADCFCD77C
1 changed files with 13 additions and 4 deletions

17
url.c
View File

@ -24,9 +24,19 @@
#include "chat.h" #include "chat.h"
static const char *Schemes[] = { static const char *Schemes[] = {
"https:", "cvs:",
"http:",
"ftp:", "ftp:",
"git:",
"http:",
"https:",
"irc:",
"ircs:",
"magnet:",
"sftp:",
"ssh:",
"svn:",
"telnet:",
"vnc:",
}; };
static const size_t SchemesLen = sizeof(Schemes) / sizeof(Schemes[0]); static const size_t SchemesLen = sizeof(Schemes) / sizeof(Schemes[0]);
@ -81,8 +91,7 @@ void urlOpenMatch(struct Tag tag, const char *substr) {
struct Entry entry = ringEntry(i); struct Entry entry = ringEntry(i);
if (!entry.url || entry.tag != tag.id) continue; if (!entry.url || entry.tag != tag.id) continue;
if (!strstr(entry.url, substr)) continue; if (!strstr(entry.url, substr)) continue;
char *argv[] = { "open", entry.url, NULL }; eventPipe((char *[]) { "open", entry.url, NULL });
eventPipe(argv);
break; break;
} }
} }