We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e6f5f3 commit fc9059bCopy full SHA for fc9059b
lockfile.c
@@ -17,14 +17,14 @@ static void trim_last_path_component(struct strbuf *path)
17
int i = path->len;
18
19
/* back up past trailing slashes, if any */
20
- while (i && path->buf[i - 1] == '/')
+ while (i && is_dir_sep(path->buf[i - 1]))
21
i--;
22
23
/*
24
* then go backwards until a slash, or the beginning of the
25
* string
26
*/
27
- while (i && path->buf[i - 1] != '/')
+ while (i && !is_dir_sep(path->buf[i - 1]))
28
29
30
strbuf_setlen(path, i);
0 commit comments