Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit67e0412

Browse files
committed
feat(uri): starts with windows letter is not uri
1 parent8caf70c commit67e0412

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎src/nvim/path.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,6 +1749,14 @@ char_u *find_file_name_in_path(char_u *ptr, size_t len, int options, long count,
17491749
returnfile_name;
17501750
}
17511751

1752+
boolpath_starts_with_windows_drive_letter(constchar*p) {
1753+
returnstrlen(p)>=2
1754+
&& ((p[0] >='a'&&p[0] <='z')|| (p[0] >='A'&&p[0] <='Z'))
1755+
&& (p[1]==':'||p[1]=='|')
1756+
&& (strlen(p)==2|| (p[2]=='/' |p[2]=='\\' |p[2]=='?' |p[2]=='#'));
1757+
}
1758+
1759+
17521760
// Check if the ":/" of a URL is at the pointer, return URL_SLASH.
17531761
// Also check for ":\\", which MS Internet Explorer accepts, return
17541762
// URL_BACKSLASH.
@@ -1789,6 +1797,11 @@ int path_with_url(const char *fname)
17891797
return0;
17901798
}
17911799

1800+
// check if it starts with a windows drive letter
1801+
if (path_starts_with_windows_drive_letter(p)) {
1802+
return0;
1803+
}
1804+
17921805
// ":/" or ":\\" must follow
17931806
returnpath_is_url(p);
17941807
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp