Skip to content

Commit 6b1da48

Browse files
committed
lockfile.c: use is_dir_sep() instead of hardcoded '/' checks
Signed-off-by: Karsten Blees <[email protected]>
1 parent 27c549f commit 6b1da48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lockfile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ static void trim_last_path_component(struct strbuf *path)
4646
int i = path->len;
4747

4848
/* back up past trailing slashes, if any */
49-
while (i && path->buf[i - 1] == '/')
49+
while (i && is_dir_sep(path->buf[i - 1]))
5050
i--;
5151

5252
/*
5353
* then go backwards until a slash, or the beginning of the
5454
* string
5555
*/
56-
while (i && path->buf[i - 1] != '/')
56+
while (i && !is_dir_sep(path->buf[i - 1]))
5757
i--;
5858

5959
strbuf_setlen(path, i);

0 commit comments

Comments
 (0)