[PATCH v4 02/16] refs.c: use is_dir_sep() in resolve_gitlink_ref()
- From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
- Date
- Aug 23, 2017, 12:36 UTC
- Message-ID
- <20170823123704.16518-3-pclouds@gmail.com>
- In-Reply-To
- <20170823123704.16518-1-pclouds@gmail.com>
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> --- 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.11.0.157.gd943d85