From e0b3bb18304d7f011862e2996ac2c151954c03e2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 4 Dec 2018 06:59:03 +0530 Subject: [PATCH] Move URL parser enum into parser function --- kitty/line.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/line.c b/kitty/line.c index 8a688add9..64978c0fe 100644 --- a/kitty/line.c +++ b/kitty/line.c @@ -50,13 +50,13 @@ cell_text(CPUCell *cell) { static const char* url_prefixes[4] = {"https", "http", "file", "ftp"}; static size_t url_prefix_lengths[sizeof(url_prefixes)/sizeof(url_prefixes[0])] = {0}; -typedef enum URL_PARSER_STATES {ANY, FIRST_SLASH, SECOND_SLASH} URL_PARSER_STATE; static inline index_type find_colon_slash(Line *self, index_type x, index_type limit) { // Find :// at or before x index_type pos = x; - URL_PARSER_STATE state = ANY; + enum URL_PARSER_STATES {ANY, FIRST_SLASH, SECOND_SLASH}; + enum URL_PARSER_STATES state = ANY; limit = MAX(2, limit); if (pos < limit) return 0; do {