]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc: fix output filename generation on Windows
authorShenghou Ma <minux.ma@gmail.com>
Sun, 7 Oct 2012 06:14:46 +0000 (14:14 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Sun, 7 Oct 2012 06:14:46 +0000 (14:14 +0800)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6610060

src/cmd/gc/lex.c

index 46728c904dd7125d60fc9d0c2fe32ebb5cd20167..601f1829978d729d2f09818c275be655dbd54891 100644 (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