lockfile.c: use is_dir_sep() instead of hardcoded '/' checks

Signed-off-by: Karsten Blees <blees@dcon.de>
This commit is contained in:
Karsten Blees committed 2015-05-11 22:15:53 +02:00
1 parent 27c549fc85
commit 6b1da48c5b
1 file changed
+2 -2
+2 -2
View File
@@ -46,14 +46,14 @@ static void trim_last_path_component(struct strbuf *path)
int i = path->len;
/* back up past trailing slashes, if any */
while (i && path->buf[i - 1] == '/')
while (i && is_dir_sep(path->buf[i - 1]))
i--;
/*
* then go backwards until a slash, or the beginning of the
* string
*/
while (i && path->buf[i - 1] != '/')
while (i && !is_dir_sep(path->buf[i - 1]))
i--;
strbuf_setlen(path, i);