about summary refs log tree commit diff
path: root/tag.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tag.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tag.c b/tag.c
index 397c191..4a89d31 100644
--- a/tag.c
+++ b/tag.c
@@ -37,11 +37,17 @@ static struct Tag Tag(size_t id) {
 	return (struct Tag) { id, tags.name[id] };
 }
 
-struct Tag tagFor(const char *name) {
+struct Tag tagFind(const char *name) {
 	for (size_t id = 0; id < tags.len; ++id) {
 		if (strcmp(tags.name[id], name)) continue;
 		return Tag(id);
 	}
+	return TAG_NONE;
+}
+
+struct Tag tagFor(const char *name) {
+	struct Tag tag = tagFind(name);
+	if (tag.id != TAG_NONE.id) return tag;
 	if (tags.len == TAGS_LEN) return TAG_STATUS;
 	size_t id = tags.len++;
 	tags.name[id] = strdup(name);
68d&follow=1'>Remove -DNO_EXPLICIT_BZERO from Darwin.mkJune McEnroe 2019-11-06Don't install rc scripts or dirs on LinuxJune McEnroeEnroe 2018-02-05Remove gfxx reverse optionJune McEnroe 2018-02-04Fix gfxx draw stop conditionJune McEnroe 2018-02-04Reuse CGColorSpace and CGDataProvider in gfcocoaJune McEnroe 2018-02-04Mark mac target phonyJune McEnroe 2018-02-04Set up Makefile for gfxx-cocoa or gfxx-fbJune McEnroe 2018-02-04Avoid doing excessive work in gfxxJune McEnroe 2018-02-04Handle window resizing in gfcocoaJune McEnroe 2018-02-04Set cinoptionsJune McEnroe 2018-02-04Tweak colorscheme moreJune McEnroe 2018-02-04Color MatchParen DarkYellowJune McEnroe 2018-02-04Add palette sampling to gfxxJune McEnroe 2018-02-04Add 4-bit RGB to gfxxJune McEnroe 2018-02-04Add Quit menu item to gfcocoaJune McEnroe 2018-02-04Switch back to sane Objective-C styleJune McEnroe 2018-02-04Quit gfcocoa when window closesJune McEnroe 2018-02-03Apparently this is how people write Objective-CJune McEnroe