From: Eric S. Raymond Date: Thu, 18 Sep 2003 08:17:03 +0000 (+0000) Subject: Fix a bug that was nosing operation with -c and multiple args. X-Git-Tag: 2.0~10 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=237ccd164613320c7030e80391bbab67cebd9d6c;p=comparator.git Fix a bug that was nosing operation with -c and multiple args. --- diff --git a/main.c b/main.c index ef1d899..ef04997 100644 --- a/main.c +++ b/main.c @@ -552,14 +552,17 @@ main(int argc, char *argv[]) else if (compile_only) { FILE *ofp; + char *scf_out; - if (!outfile) + if (outfile) + scf_out = outfile; + else { - outfile = alloca(strlen(source) + 4); - strcpy(outfile, source); - strcat(outfile, ".scf"); + scf_out = alloca(strlen(source) + 4); + strcpy(scf_out, source); + strcat(scf_out, ".scf"); } - ofp = redirect(outfile); + ofp = redirect(scf_out); if (dir) {