summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <>2013-07-15 18:45:27 +0000
committererdgeist <>2013-07-15 18:45:27 +0000
commitf4f1db9d616de9281ebac66e2755bebbf21b7dae (patch)
tree6176d094982ea7b5413974b4e33ceebf922ca529
parent164fc41657f16f5a6527be8ca66485582248523a (diff)
Only complain about config file not found, not about formats file
-rwxr-xr-xvchat-client.c8
-rwxr-xr-xvchat.h2
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 */
173void 173void
174loadcfg (char *file,void (*lineparser) (char *)) 174loadcfg (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 *))
202void 202void
203loadconfig (char *file) 203loadconfig (char *file)
204{ 204{
205 loadcfg(file,parsecfg); 205 loadcfg(file,1,parsecfg);
206} 206}
207 207
208void 208void
209loadformats (char *file) 209loadformats (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 */
diff --git a/vchat.h b/vchat.h
index 541fd21..7b6e0d3 100755
--- a/vchat.h
+++ b/vchat.h
@@ -80,7 +80,7 @@ extern unsigned int loggedin;
80#define ERRSTRSIZE 1024 80#define ERRSTRSIZE 1024
81extern char errstr[]; 81extern char errstr[];
82extern char *vchat_cl_version; 82extern char *vchat_cl_version;
83void loadcfg (char *file,void (*lineparser) (char *)); 83void loadcfg (char *file,int complain,void (*lineparser) (char *));
84void loadformats (char *file); 84void loadformats (char *file);
85void cleanup(int signal); 85void cleanup(int signal);
86 86