diff options
| author | erdgeist <> | 2013-07-15 18:45:27 +0000 |
|---|---|---|
| committer | erdgeist <> | 2013-07-15 18:45:27 +0000 |
| commit | f4f1db9d616de9281ebac66e2755bebbf21b7dae (patch) | |
| tree | 6176d094982ea7b5413974b4e33ceebf922ca529 | |
| parent | 164fc41657f16f5a6527be8ca66485582248523a (diff) | |
Only complain about config file not found, not about formats file
| -rwxr-xr-x | vchat-client.c | 8 | ||||
| -rwxr-xr-x | vchat.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/vchat-client.c b/vchat-client.c index d5960a5..71a596c 100755 --- a/vchat-client.c +++ b/vchat-client.c | |||
| @@ -171,7 +171,7 @@ static void parseknownhosts(char *line) { | |||
| 171 | 171 | ||
| 172 | /* load config file */ | 172 | /* load config file */ |
| 173 | void | 173 | void |
| 174 | loadcfg (char *file,void (*lineparser) (char *)) | 174 | loadcfg (char *file,int complain, void (*lineparser) (char *)) |
| 175 | { | 175 | { |
| 176 | FILE *fh; | 176 | FILE *fh; |
| 177 | #define BUFSIZE 4096 | 177 | #define BUFSIZE 4096 |
| @@ -186,7 +186,7 @@ loadcfg (char *file,void (*lineparser) (char *)) | |||
| 186 | free( tildex ); | 186 | free( tildex ); |
| 187 | 187 | ||
| 188 | if (!fh) { | 188 | if (!fh) { |
| 189 | snprintf (errstr, TMPSTRSIZE, "Can't open config-file \"%s\": %s.", file, strerror(errno)); | 189 | if( complain ) snprintf (errstr, TMPSTRSIZE, "Can't open config-file \"%s\": %s.", file, strerror(errno)); |
| 190 | return; | 190 | return; |
| 191 | } | 191 | } |
| 192 | 192 | ||
| @@ -202,13 +202,13 @@ loadcfg (char *file,void (*lineparser) (char *)) | |||
| 202 | void | 202 | void |
| 203 | loadconfig (char *file) | 203 | loadconfig (char *file) |
| 204 | { | 204 | { |
| 205 | loadcfg(file,parsecfg); | 205 | loadcfg(file,1,parsecfg); |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | void | 208 | void |
| 209 | loadformats (char *file) | 209 | loadformats (char *file) |
| 210 | { | 210 | { |
| 211 | loadcfg(file,parseformats); | 211 | loadcfg(file,0,parseformats); |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | /* get-format-string */ | 214 | /* get-format-string */ |
| @@ -80,7 +80,7 @@ extern unsigned int loggedin; | |||
| 80 | #define ERRSTRSIZE 1024 | 80 | #define ERRSTRSIZE 1024 |
| 81 | extern char errstr[]; | 81 | extern char errstr[]; |
| 82 | extern char *vchat_cl_version; | 82 | extern char *vchat_cl_version; |
| 83 | void loadcfg (char *file,void (*lineparser) (char *)); | 83 | void loadcfg (char *file,int complain,void (*lineparser) (char *)); |
| 84 | void loadformats (char *file); | 84 | void loadformats (char *file); |
| 85 | void cleanup(int signal); | 85 | void cleanup(int signal); |
| 86 | 86 | ||
