From 8110bc3af5c547b91cdd863c575b5a9c13f62b8e Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Sun, 10 Feb 2019 20:34:20 -0500 Subject: Add plain text "language" to hi --- bin/hi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bin/hi.c') diff --git a/bin/hi.c b/bin/hi.c index 50b9b064..8a254ce9 100644 --- a/bin/hi.c +++ b/bin/hi.c @@ -213,6 +213,7 @@ static const struct Language { { "make", "[.]mk$|^Makefile$", MakeSyntax, ARRAY_LEN(MakeSyntax) }, { "mdoc", "[.][1-9]$", MdocSyntax, ARRAY_LEN(MdocSyntax) }, { "sh", "[.]sh$", ShSyntax, ARRAY_LEN(ShSyntax) }, + { "text", "[.]txt$", NULL, 0 }, }; static regex_t compile(const char *pattern, int flags) { @@ -634,7 +635,7 @@ int main(int argc, char *argv[]) { name = strrchr(path, '/'); name = (name ? &name[1] : path); } - if (!lang.syntax && !matchLanguage(&lang, name)) { + if (!lang.name && !matchLanguage(&lang, name)) { errx(EX_USAGE, "cannot infer language for %s", name); } if (!opts[Title]) opts[Title] = name; -- cgit 1.4.1