mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-21 15:30:15 -05:00
lockfile.c: use is_dir_sep() instead of hardcoded '/' checks
Signed-off-by: Karsten Blees <blees@dcon.de>
This commit is contained in:
committed by
Johannes Schindelin
parent
42cf85d79b
commit
fa1bf3817e
@@ -19,14 +19,14 @@ static void trim_last_path_component(struct strbuf *path)
|
|||||||
int i = path->len;
|
int i = path->len;
|
||||||
|
|
||||||
/* back up past trailing slashes, if any */
|
/* back up past trailing slashes, if any */
|
||||||
while (i && path->buf[i - 1] == '/')
|
while (i && is_dir_sep(path->buf[i - 1]))
|
||||||
i--;
|
i--;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* then go backwards until a slash, or the beginning of the
|
* then go backwards until a slash, or the beginning of the
|
||||||
* string
|
* string
|
||||||
*/
|
*/
|
||||||
while (i && path->buf[i - 1] != '/')
|
while (i && !is_dir_sep(path->buf[i - 1]))
|
||||||
i--;
|
i--;
|
||||||
|
|
||||||
strbuf_setlen(path, i);
|
strbuf_setlen(path, i);
|
||||||
|
|||||||
Reference in New Issue
Block a user