Skip to content

Commit 6ec06e4

Browse files
kbleesdscho
authored andcommitted
lockfile.c: use is_dir_sep() instead of hardcoded '/' checks
Signed-off-by: Karsten Blees <[email protected]>
1 parent 197770e commit 6ec06e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lockfile.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ static void trim_last_path_component(struct strbuf *path)
1919
int i = path->len;
2020

2121
/* back up past trailing slashes, if any */
22-
while (i && path->buf[i - 1] == '/')
22+
while (i && is_dir_sep(path->buf[i - 1]))
2323
i--;
2424

2525
/*
2626
* then go backwards until a slash, or the beginning of the
2727
* string
2828
*/
29-
while (i && path->buf[i - 1] != '/')
29+
while (i && !is_dir_sep(path->buf[i - 1]))
3030
i--;
3131

3232
strbuf_setlen(path, i);

0 commit comments

Comments
 (0)