refs.c: use is_dir_sep() in resolve_gitlink_ref()
The "submodule" argument in this function is a path, which can have either '/' or '\\' as a separator. Use is_dir_sep() to support both. Noticed-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Aug 23, 2017 at 19:36 UTC
ee394bd376e833d8e9e38f81c57f6b4a370e8a92
1 file changed
+1
-1
refs.c
+1
-1
@@ -1507,7 +1507,7 @@ int resolve_gitlink_ref(const char *submodule, const char *refname,
1507
struct ref_store *refs;
1508
int flags;
1509
1510
- while (len && submodule[len - 1] == '/')
1510
+ while (len && is_dir_sep(submodule[len - 1]))
1511
len--;
1512
1513
if (!len)