about summary refs log tree commit diff
path: root/ui-shared.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-12-27 19:19:24 -0500
committerRory& <root@rory.gay>2026-02-06 14:05:51 +0100
commit476711821c3ff970a9262ed9f74be233d23c8d35 (patch)
tree243032b11b04c2f9a056e0ca4cc7897fa248e78c /ui-shared.c
parentgit: update to v2.53.0 (diff)
downloadcgit-magenta-476711821c3ff970a9262ed9f74be233d23c8d35.tar.xz
Remove dependency on memrchr
Not available on macOS.
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui-shared.c b/ui-shared.c

index 838170a..6b6850f 100644 --- a/ui-shared.c +++ b/ui-shared.c
@@ -1250,9 +1250,12 @@ void cgit_set_title_from_path(const char *path) if (!path) return; - for (last_slash = path + strlen(path); (slash = memrchr(path, '/', last_slash - path)) != NULL; last_slash = slash) { + last_slash = path + strlen(path); + for (slash = last_slash; slash > path; --slash) { + if (*slash != '/') continue; strbuf_add(&sb, slash + 1, last_slash - slash - 1); strbuf_addstr(&sb, " \xc2\xab "); + last_slash = slash; } strbuf_add(&sb, path, last_slash - path); strbuf_addf(&sb, " - %s", ctx.page.title);