]> Cypherpunks repositories - gostls13.git/commitdiff
fix import dot bug
authorRuss Cox <rsc@golang.org>
Wed, 19 Aug 2009 18:32:46 +0000 (11:32 -0700)
committerRuss Cox <rsc@golang.org>
Wed, 19 Aug 2009 18:32:46 +0000 (11:32 -0700)
R=ken
OCL=33526
CL=33528

src/cmd/gc/go.h
src/cmd/gc/subr.c
test/fixedbugs/bug191.dir/a.go [new file with mode: 0644]
test/fixedbugs/bug191.dir/b.go [new file with mode: 0644]
test/fixedbugs/bug191.go [new file with mode: 0644]

index 5768a5546176fa7582482d6544f57c638ecf510f..e13d7bdd0d540f35c784e9b9da413ccd9df29a71 100644 (file)
@@ -956,7 +956,6 @@ NodeList*   initfix(NodeList*);
 /*
  *     export.c
  */
-void   renameimports(void);
 void   autoexport(Node*, int);
 int    exportname(char*);
 void   exportsym(Node*);
index 8a4cd80d51350373b1ba162cc825c901417d1991..c566b7f070952e50bfccd310e23afe02f63483e4 100644 (file)
@@ -239,7 +239,7 @@ importdot(Sym *opkg)
                for(s = hash[h]; s != S; s = s->link) {
                        if(s->package[0] != c)
                                continue;
-                       if(!exportname(s->name))
+                       if(!exportname(s->name) || utfrune(s->name, 0xb7))      // 0xb7 = center dot
                                continue;
                        if(strcmp(s->package, opkg->name) != 0)
                                continue;
diff --git a/test/fixedbugs/bug191.dir/a.go b/test/fixedbugs/bug191.dir/a.go
new file mode 100644 (file)
index 0000000..6734035
--- /dev/null
@@ -0,0 +1,9 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package a
+
+func init() {
+       println("a");
+}
diff --git a/test/fixedbugs/bug191.dir/b.go b/test/fixedbugs/bug191.dir/b.go
new file mode 100644 (file)
index 0000000..a2d5596
--- /dev/null
@@ -0,0 +1,9 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package b
+
+func init() {
+       println("b");
+}
diff --git a/test/fixedbugs/bug191.go b/test/fixedbugs/bug191.go
new file mode 100644 (file)
index 0000000..fe03f64
--- /dev/null
@@ -0,0 +1,13 @@
+// $G $D/bug191.dir/a.go && $G $D/bug191.dir/b.go && $G $D/$F.go && $L $F.$A
+
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import . "./a"
+import . "./b"
+
+func main() {
+}