From 8ed9fc600c7dc6a9286a6f04bdb41694d53bac3c Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Tue, 12 Jul 2011 14:22:48 +1000 Subject: [PATCH] 6l: change default output name to 6.out.exe on windows R=golang-dev, vcc.163 CC=golang-dev https://golang.org/cl/4670049 --- src/cmd/6l/obj.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/cmd/6l/obj.c b/src/cmd/6l/obj.c index e3191bb4dc..71649473d2 100644 --- a/src/cmd/6l/obj.c +++ b/src/cmd/6l/obj.c @@ -84,7 +84,7 @@ main(int argc, char *argv[]) listinit(); memset(debug, 0, sizeof(debug)); nerrors = 0; - outfile = "6.out"; + outfile = nil; HEADTYPE = -1; INITTEXT = -1; INITDAT = -1; @@ -134,11 +134,20 @@ main(int argc, char *argv[]) if(argc != 1) usage(); - libinit(); + mywhatsys(); // get goos if(HEADTYPE == -1) HEADTYPE = headtype(goos); + if(outfile == nil) { + if(HEADTYPE == Hwindows) + outfile = "6.out.exe"; + else + outfile = "6.out"; + } + + libinit(); + switch(HEADTYPE) { default: diag("unknown -H option");