# HG changeset patch # User szabii # Date 986948228 0 # Node ID e24fe1b5b918ec057242f2ece6d7bc01134ae622 # Parent 901e7f28bb6057f85940e9057bbba3b6e009a205 less output diff -r 901e7f28bb60 -r e24fe1b5b918 cfgparser.c --- a/cfgparser.c Tue Apr 10 23:56:38 2001 +0000 +++ b/cfgparser.c Wed Apr 11 00:17:08 2001 +0000 @@ -1,5 +1,7 @@ /* * command line and config file parser + * by Szabolcs Berecz + * (C) 2001 */ //#define DEBUG @@ -10,6 +12,7 @@ #include #include #include +#include #define ERR_NOT_AN_OPTION -1 #define ERR_MISSING_PARAM -2 @@ -248,7 +251,7 @@ 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 @@ } 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 @@ } else { found_filename = 1; *filename = argv[i]; - printf("parse_command_line: found filename: %s\n", *filename); continue; /* next option */ } break;