diff options
author | monsta <[email protected]> | 2016-07-29 16:35:13 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-07-29 16:35:13 +0300 |
commit | a63c9b3ec8337238322f967762a23511a5ee8262 (patch) | |
tree | d1393483d52308d2d47586e652f485a98fe01cbc | |
parent | 16e3394af0885a78b30adccc6819f03bf0d84dee (diff) | |
download | caja-extensions-a63c9b3ec8337238322f967762a23511a5ee8262.tar.bz2 caja-extensions-a63c9b3ec8337238322f967762a23511a5ee8262.tar.xz |
open-terminal: use g_uri_parse_scheme
-rw-r--r-- | open-terminal/caja-open-terminal.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/open-terminal/caja-open-terminal.c b/open-terminal/caja-open-terminal.c index 41eeed8..c3760e8 100644 --- a/open-terminal/caja-open-terminal.c +++ b/open-terminal/caja-open-terminal.c @@ -67,15 +67,11 @@ static TerminalFileInfo get_terminal_file_info (CajaFileInfo *file_info) { TerminalFileInfo ret; - char *uri_scheme, *p; + char *uri; + char *uri_scheme; - g_assert (file_info); - - uri_scheme = caja_file_info_get_activation_uri (file_info); - p = strchr (uri_scheme, ':'); - if (p) { - *p = 0; - } + uri = caja_file_info_get_activation_uri (file_info); + uri_scheme = g_uri_parse_scheme (uri); if (strcmp (uri_scheme, "file") == 0) { ret = FILE_INFO_LOCAL; @@ -89,6 +85,7 @@ get_terminal_file_info (CajaFileInfo *file_info) } g_free (uri_scheme); + g_free (uri); return ret; } |