]> thyrsus.com Git - comparator.git/commitdiff
Fix a bug that was nosing operation with -c and multiple args.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 18 Sep 2003 08:17:03 +0000 (08:17 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 18 Sep 2003 08:17:03 +0000 (08:17 +0000)
main.c

diff --git a/main.c b/main.c
index ef1d899db89233245f34d831c40e762927841c71..ef04997e212b765c500de38e3210e82d3f1b8fcc 100644 (file)
--- 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)
            {