Update of /cvsroot/mplayer/main In directory usw-pr-cvs1:/tmp/cvs-serv27831 Modified Files: cfgparser.c Log Message: : No such... fix Index: cfgparser.c =================================================================== RCS file: /cvsroot/mplayer/main/cfgparser.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** cfgparser.c 2001/06/09 00:00:57 1.18 --- cfgparser.c 2001/06/09 17:30:40 1.19 *************** *** 254,258 **** } ! if (verbose) printf("Reading config file: %s", conffile); if (init_conf(conf, CONFIG_FILE) == -1) { --- 254,258 ---- } ! // printf("Reading config file: %s", conffile); if (init_conf(conf, CONFIG_FILE) == -1) { *************** *** 268,278 **** if ((fp = fopen(conffile, "r")) == NULL) { ! if (!verbose) printf("Reading config file: %s", conffile); ! printf(": %s\n", strerror(errno)); free(line); ret = 0; goto out; } ! if (verbose) printf("\n"); while (fgets(line, MAX_LINE_LEN, fp)) { --- 268,277 ---- if ((fp = fopen(conffile, "r")) == NULL) { ! // printf(": %s\n", strerror(errno)); free(line); ret = 0; goto out; } ! // printf("\n"); while (fgets(line, MAX_LINE_LEN, fp)) { *************** *** 419,424 **** for (i = 1; i < argc; i++) { opt = argv[i]; ! if (*opt != '-') ! goto not_an_option; /* remove trailing '-' */ --- 418,428 ---- for (i = 1; i < argc; i++) { opt = argv[i]; ! if (*opt != '-') { ! if (found_filename) { ! printf("invalid option:\n"); ! goto err_out; ! } ! goto filename; ! } /* remove trailing '-' */ *************** *** 429,442 **** switch (tmp) { case ERR_NOT_AN_OPTION: - not_an_option: /* opt is not an option -> treat it as a filename */ if (found_filename) { /* we already have a filename */ goto err_out; - } else { - found_filename = 1; - *filename = argv[i]; - continue; /* next option */ } break; case ERR_MISSING_PARAM: --- 433,444 ---- switch (tmp) { case ERR_NOT_AN_OPTION: /* opt is not an option -> treat it as a filename */ if (found_filename) { /* we already have a filename */ goto err_out; } + filename: + found_filename = 1; + *filename = argv[i]; break; case ERR_MISSING_PARAM: *************** *** 445,455 **** goto err_out; /* break; */ } - - i += tmp; /* we already processed the params (if there was any) */ } return found_filename; err_out: ! printf("parse_command_line: %s\n", argv[i]); return -1; } --- 447,457 ---- goto err_out; /* break; */ + default: + i += tmp; } } return found_filename; err_out: ! printf("command line: %s\n", argv[i]); return -1; } _______________________________________________ Mplayer-cvslog mailing list Mplayer-cvslog@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
participants (1)
-
Szabolcs Berecz