From f434f9cd4eabfcad3a90711494febbfd89e4ed5f Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Tue, 27 Sep 2011 14:41:29 +0000 Subject: fix COMMAND_FORMAT parameters --- vchat-commands.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/vchat-commands.c b/vchat-commands.c index 5499948..b3c955e 100755 --- a/vchat-commands.c +++ b/vchat-commands.c @@ -15,10 +15,13 @@ */ /* general includes */ +#include #include #include #include #include +#include +#include /* local includes */ #include "vchat.h" @@ -40,6 +43,7 @@ COMMAND_LSFLT, COMMAND_RMFLT, COMMAND_CLFLT, COMMAND_HELP, +COMMAND_FORMAT, COMMAND_KEYS, COMMAND_QUIT, COMMAND_USER, @@ -304,20 +308,20 @@ command_format(char *line) { flushout(); while( *line==' ') line++; - if(file) { - tildex = tilde_expand( file ); - if(tildex && !stat(file, &testexist )) - loadformats(file); + if(line) { + tildex = tilde_expand( line ); + if(tildex && !stat(tildex, &testexist )) + loadformats(tildex); else { #define BUFSIZE 4096 char buf[BUFSIZE]; - snprintf( buf, BUFSIZE, "~/.vchat/sample-%s.fmt", file ); + snprintf( buf, BUFSIZE, "~/.vchat/sample-%s.fmt", line ); free(tildex); - tildex = tilde_expand( file ); - if(tildex && !stat(file, &testexist )) - loadformats(file); + tildex = tilde_expand( line ); + if(tildex && !stat(tildex, &testexist )) + loadformats(tildex); } - + writeout(" Sort of done. "); } else { writeout(" Forgot to specify format file. "); } -- cgit v1.2.3