From f57cc5da1bceb61004225067c5c2111b96ebfdd7 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Wed, 14 Sep 2005 15:31:01 +0000 Subject: (main): Fixed coredump when no arguments were passed. --- src/main.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 11cec84..296a62d 100644 --- a/src/main.c +++ b/src/main.c @@ -667,14 +667,15 @@ main(int argc, char **argv) init(); - /* See comment to cleanup_processor */ - for (arglist = CAR(arglist); arglist; arglist = CDR(arglist)) { - char *s = (char*)CAR(arglist); - if (s[0] == '-') - pp_option(s); - else if (source(s) == 0) - yyparse(); - } + if (arglist) + /* See comment to cleanup_processor */ + for (arglist = CAR(arglist); arglist; arglist = CDR(arglist)) { + char *s = (char*)CAR(arglist); + if (s[0] == '-') + pp_option(s); + else if (source(s) == 0) + yyparse(); + } argc -= index; argv += index; -- cgit v1.2.1