cmd/gc: fix output filename generation on Windows

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6610060
This commit is contained in:
Shenghou Ma 2012-10-07 14:14:46 +08:00
parent 51e8fe5b1b
commit 9224b4c873
1 changed files with 6 additions and 1 deletions

View File

@ -2190,7 +2190,7 @@ mkpackage(char* pkgname)
{
Sym *s;
int32 h;
char *p;
char *p, *q;
if(localpkg->name == nil) {
if(strcmp(pkgname, "_") == 0)
@ -2230,6 +2230,11 @@ mkpackage(char* pkgname)
if(outfile == nil) {
p = strrchr(infile, '/');
if(windows) {
q = strrchr(infile, '\\');
if(q > p)
p = q;
}
if(p == nil)
p = infile;
else