summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-12-27 19:19:24 -0500
committerJune McEnroe <june@causal.agency>2020-12-27 19:21:11 -0500
commit06aa8a5c2c44c34f450868bf829736b091e9d8d0 (patch)
treefc8ed3e4b7d0f08175d99c4d5e0130f6168593ba
parentRemove cgit/git submodule (diff)
downloadsrc-06aa8a5c2c44c34f450868bf829736b091e9d8d0.tar.gz
src-06aa8a5c2c44c34f450868bf829736b091e9d8d0.zip
Remove dependency on memrchr
-rw-r--r--www/git.causal.agency/cgit/ui-shared.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/www/git.causal.agency/cgit/ui-shared.c b/www/git.causal.agency/cgit/ui-shared.c
index d2358f29..a2951023 100644
--- a/www/git.causal.agency/cgit/ui-shared.c
+++ b/www/git.causal.agency/cgit/ui-shared.c
@@ -1200,9 +1200,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);
;id=cac3f7de51e425f914a96270c2fa92b84ffd205f&follow=1'>Add version number generatorJune McEnroe 2021-08-22Add ISC license headerJune McEnroe 2021-08-22Update to Linux man-pages 5.12Štěpán Němec 2021-06-21Add manuals for macOS 11.3June McEnroe 2021-05-08Update to OpenBSD 6.9June McEnroe 2021-04-26Update to Linux man-pages 5.11June McEnroe 2021-04-26Update to FreeBSD 13.0June McEnroe 2021-01-27Completely rewrite how manuals are fetched and installedJune McEnroe Also add section 6 manuals from NetBSD and OpenBSD! 2020-12-14Update to man-pages-posix 2017-aJune McEnroe 2020-12-14Update to OpenBSD 6.8June McEnroe 2020-12-14Update to NetBSD 9.1June McEnroe 2020-12-14Update to man-pages 5.09June McEnroe 2020-12-14Update to FreeBSD 12.2June McEnroe 2020-06-08Update to OpenBSD 6.7June McEnroe 2020-05-04Add hack for macOS to search extra man sectionsJune McEnroe 2020-05-04Don't clear MANSECTJune McEnroe