From ee394bd376e833d8e9e38f81c57f6b4a370e8a92 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Wed, 23 Aug 2017 19:36:50 +0700 Subject: [PATCH] refs.c: use is_dir_sep() in resolve_gitlink_ref() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- refs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refs.c b/refs.c index 3d549a8970..dec899a57a 100644 --- a/refs.c +++ b/refs.c @@ -1507,7 +1507,7 @@ int resolve_gitlink_ref(const char *submodule, const char *refname, struct ref_store *refs; int flags; - while (len && submodule[len - 1] == '/') + while (len && is_dir_sep(submodule[len - 1])) len--; if (!len) -- 2.48.1