mirror of
https://github.com/git-for-windows/git.git
synced 2025-12-15 12:58:18 -06:00
lockfile.c: use is_dir_sep() instead of hardcoded '/' checks
Signed-off-by: Karsten Blees <blees@dcon.de>
This commit is contained in:
parent
ae79b5848c
commit
eaadc6a45c
@ -19,14 +19,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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user