summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2018-12-02 13:35:45 +0900
committerjaseg <git@jaseg.net>2018-12-02 13:37:59 +0900
commita21247efe188c9407663a2c3eac0cbb0547e05b8 (patch)
tree82a9f076632fe42ef1a9f138aeb6ae7349167b8a
parent38db5de767adae9544f24bca9bc1dd43e827cf10 (diff)
downloadlolcat-1.0.tar.gz
lolcat-1.0.tar.bz2
lolcat-1.0.zip
Pull out inline function to make clang happyv1.0
Thanks @Janfel and @dosentmatter for reporting this. Fixes #14.
-rw-r--r--lolcat.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/lolcat.c b/lolcat.c
index 8e13da7..b141d4b 100644
--- a/lolcat.c
+++ b/lolcat.c
@@ -76,6 +76,17 @@ static void version(void)
exit(0);
}
+static wint_t helpstr_hack(FILE * _ignored)
+{
+ (void)_ignored;
+ static size_t idx = 0;
+ char c = helpstr[idx++];
+ if (c)
+ return c;
+ idx = 0;
+ return WEOF;
+}
+
int main(int argc, char** argv)
{
char* default_argv[] = { "-" };
@@ -138,17 +149,6 @@ int main(int argc, char** argv)
FILE* f;
int escape_state = 0;
- wint_t helpstr_hack(FILE * _ignored)
- {
- (void)_ignored;
- static size_t idx = 0;
- char c = helpstr[idx++];
- if (c)
- return c;
- idx = 0;
- return WEOF;
- }
-
if (!strcmp(*filename, "--help")) {
this_file_read_wchar = &helpstr_hack;
f = 0;