diff options
Diffstat (limited to 'src/utils.c')
-rw-r--r-- | src/utils.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c index b43af5de..74ba6100 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1464,6 +1464,21 @@ gchar *get_uri_path(const gchar *uri) return (gchar *)uri; } +gint get_uri_len(const gchar *str) +{ + const gchar *p; + + if (is_uri_string(str)) { + for (p = str; *p != '\0'; p++) { + if (!g_ascii_isgraph(*p) || strchr("()<>\"", *p)) + break; + } + return p - str; + } + + return 0; +} + /* Decodes URL-Encoded strings (i.e. strings in which spaces are replaced by * plusses, and escape characters are used) */ |