1
0
mirror of https://github.com/golang/go synced 2024-11-22 00:44:39 -07:00

fix import dot bug

R=ken
OCL=33526
CL=33528
This commit is contained in:
Russ Cox 2009-08-19 11:32:46 -07:00
parent 0f17fc0e50
commit 63aeaa2a03
5 changed files with 32 additions and 2 deletions

View File

@ -956,7 +956,6 @@ NodeList* initfix(NodeList*);
/*
* export.c
*/
void renameimports(void);
void autoexport(Node*, int);
int exportname(char*);
void exportsym(Node*);

View 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;

View File

@ -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");
}

View File

@ -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");
}

13
test/fixedbugs/bug191.go Normal file
View File

@ -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() {
}