From 237ccd164613320c7030e80391bbab67cebd9d6c Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 18 Sep 2003 08:17:03 +0000 Subject: [PATCH] Fix a bug that was nosing operation with -c and multiple args. --- main.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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) { -- 2.43.0