From 6b94d4d14f701b76b61a2c45862dff98d011f447 Mon Sep 17 00:00:00 2001 From: Rui Abreu Ferreira Date: Sun, 14 Aug 2016 11:20:40 +0100 Subject: [PATCH] Windows: Check drive letter in absolute paths Check if drive letter is alphabetic character in path_is_absolute_path(). --- src/nvim/path.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/path.c b/src/nvim/path.c index 4a47a70799..80eeac9e74 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -2191,7 +2191,7 @@ int path_is_absolute_path(const char_u *fname) { #ifdef WIN32 // A name like "d:/foo" and "//server/share" is absolute - return ((fname[0] && fname[1] == ':' && (fname[2] == '/' || fname[2] == '\\')) + return ((isalpha(fname[0]) && fname[1] == ':' && (fname[2] == '/' || fname[2] == '\\')) || (fname[0] == fname[1] && (fname[0] == '/' || fname[0] == '\\'))); #else // UNIX: This just checks if the file name starts with '/' or '~'.