From: Cyril Roelandt Date: Wed, 25 Jan 2012 04:07:39 +0000 (+0100) Subject: remove nested functions X-Git-Url: http://royale.zerezo.com/git/?a=commitdiff_plain;h=d07bc64a1481a9048d32ece28844cf3d087ca922;p=irssistats 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. --- 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];