Commit 33f3afa7 authored by Russ Cox's avatar Russ Cox

gc: diagnose \ in import path

R=ken2
CC=golang-dev
https://golang.org/cl/5609044
parent 6aa6fdcf
...@@ -574,6 +574,11 @@ importfile(Val *f, int line) ...@@ -574,6 +574,11 @@ importfile(Val *f, int line)
yyerror("import path contains NUL"); yyerror("import path contains NUL");
errorexit(); errorexit();
} }
if(strchr(f->u.sval->s, '\\')) {
yyerror("import path contains backslash; use slash");
errorexit();
}
// The package name main is no longer reserved, // The package name main is no longer reserved,
// but we reserve the import path "main" to identify // but we reserve the import path "main" to identify
......
// errchk $G -e $D/$F.go
// 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.
// import paths are slash-separated; reject backslash
package main
import `net\http` // ERROR "backslash"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment