From d07bc64a1481a9048d32ece28844cf3d087ca922 Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Wed, 25 Jan 2012 05:07:39 +0100 Subject: [PATCH 1/1] remove nested functions irssistats uses nested functions (cf. irssistats.c:1566). It seems to me that nested functions are not part of the C standard (they are a GCC extension), which makes irssistats impossible to compile with compilers that do not support this feature. For example, clang fails to compile it. --- irssistats.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/irssistats.c b/irssistats.c index ea31cee..2ac92a7 100644 --- a/irssistats.c +++ b/irssistats.c @@ -1561,19 +1561,19 @@ void gen_xhtml(char *xhtmlfile) fclose(fic); } -void parse_config(char *configfile) +void expand(char *path) { - void expand(char *path) + char temp[MAXLINELENGTH]; + if (*path=='~') { - char temp[MAXLINELENGTH]; - if (*path=='~') - { - snprintf(temp,MAXLINELENGTH-1,"%s%s",getenv("HOME"),path+1); - temp[MAXLINELENGTH-1]='\0'; - strcpy(path,temp); - } + snprintf(temp,MAXLINELENGTH-1,"%s%s",getenv("HOME"),path+1); + temp[MAXLINELENGTH-1]='\0'; + strcpy(path,temp); } - +} + +void parse_config(char *configfile) +{ FILE *fic; char line[MAXLINELENGTH]; char keyword[MAXLINELENGTH]; -- 2.20.1