aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Bainter <mbainter+github@gmail.com>2015-04-20 13:33:08 +0000
committerMark Bainter <mbainter+github@gmail.com>2015-05-06 21:25:04 -0500
commit3128ff37988bb36e27d77539001631b62d89d88c (patch)
tree626f7704b8155bdb1f273e2992bc633701ee3102
parent1f768572323f8d1c1c802ff1e00f696ce1ffbe88 (diff)
downloadrneovim-3128ff37988bb36e27d77539001631b62d89d88c.tar.gz
rneovim-3128ff37988bb36e27d77539001631b62d89d88c.tar.bz2
rneovim-3128ff37988bb36e27d77539001631b62d89d88c.zip
Remove char_u: path_is_url()
-rw-r--r--src/nvim/path.c14
-rw-r--r--src/nvim/window.c4
2 files changed, 8 insertions, 10 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c
index 2f7d0fd4dd..d15dbb33fe 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -1521,16 +1521,14 @@ find_file_name_in_path (
return file_name;
}
-/*
- * Check if the "://" of a URL is at the pointer, return URL_SLASH.
- * Also check for ":\\", which MS Internet Explorer accepts, return
- * URL_BACKSLASH.
- */
-int path_is_url(char_u *p)
+// Check if the "://" of a URL is at the pointer, return URL_SLASH.
+// Also check for ":\\", which MS Internet Explorer accepts, return
+// URL_BACKSLASH.
+int path_is_url(const char *p)
{
- if (STRNCMP(p, "://", (size_t)3) == 0)
+ if (strncmp(p, "://", 3) == 0)
return URL_SLASH;
- else if (STRNCMP(p, ":\\\\", (size_t)3) == 0)
+ else if (strncmp(p, ":\\\\", 3) == 0)
return URL_BACKSLASH;
return 0;
}
diff --git a/src/nvim/window.c b/src/nvim/window.c
index f69d3aa78c..c97dc22741 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -4916,7 +4916,7 @@ file_name_in_line (
if (has_mbyte && (len = (size_t)((*mb_head_off)(line, ptr - 1))) > 0)
ptr -= len + 1;
else if (vim_isfilec(ptr[-1])
- || ((options & FNAME_HYP) && path_is_url(ptr - 1)))
+ || ((options & FNAME_HYP) && path_is_url((char *)ptr - 1)))
--ptr;
else
break;
@@ -4928,7 +4928,7 @@ file_name_in_line (
*/
len = 0;
while (vim_isfilec(ptr[len])
- || ((options & FNAME_HYP) && path_is_url(ptr + len)))
+ || ((options & FNAME_HYP) && path_is_url((char *)ptr + len)))
if (has_mbyte)
len += (size_t)(*mb_ptr2len)(ptr + len);
else