summaryrefslogtreecommitdiffstats
path: root/cfgparser.c
diff options
context:
space:
mode:
authorszabii <szabii@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-11 00:17:08 +0000
committerszabii <szabii@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-11 00:17:08 +0000
commitac106f89b40f15050c36b0e99d452e774f0c7ce9 (patch)
tree36050570f38cfd55f6f183a155c54a9066c66d07 /cfgparser.c
parent5f20b1fd928cb74cec7dfdd8f2b2e2904555e6b6 (diff)
downloadmpv-ac106f89b40f15050c36b0e99d452e774f0c7ce9.tar.bz2
mpv-ac106f89b40f15050c36b0e99d452e774f0c7ce9.tar.xz
less output
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@337 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'cfgparser.c')
-rw-r--r--cfgparser.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/cfgparser.c b/cfgparser.c
index 21ec21d3c6..bce2bb6b5d 100644
--- a/cfgparser.c
+++ b/cfgparser.c
@@ -1,5 +1,7 @@
/*
* command line and config file parser
+ * by Szabolcs Berecz <szabi@inf.elte.hu>
+ * (C) 2001
*/
//#define DEBUG
@@ -10,6 +12,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
+#include <errno.h>
#define ERR_NOT_AN_OPTION -1
#define ERR_MISSING_PARAM -2
@@ -248,7 +251,7 @@ int parse_config_file(struct config *conf, char *conffile)
return -1;
}
- printf("Reading config file: %s\n", conffile);
+ printf("Reading config file: %s", conffile);
if (init_conf(conf, CONFIG_FILE) == -1) {
ret = -1;
@@ -256,17 +259,18 @@ int parse_config_file(struct config *conf, char *conffile)
}
if ((line = (char *) malloc(MAX_LINE_LEN + 1)) == NULL) {
- perror("parse_config_file: can't get memory for 'line'");
+ perror("\ncan't get memory for 'line'");
ret = -1;
goto out;
}
if ((fp = fopen(conffile, "r")) == NULL) {
- perror("parse_config_file: can't open filename");
+ printf(": %s\n", strerror(errno));
free(line);
ret = 0;
goto out;
}
+ printf("\n");
while (fgets(line, MAX_LINE_LEN, fp)) {
line_num++;
@@ -426,7 +430,6 @@ not_an_option:
} else {
found_filename = 1;
*filename = argv[i];
- printf("parse_command_line: found filename: %s\n", *filename);
continue; /* next option */
}
break;