Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
33f3afa7
Commit
33f3afa7
authored
Jan 31, 2012
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: diagnose \ in import path
R=ken2 CC=golang-dev
https://golang.org/cl/5609044
parent
6aa6fdcf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
src/cmd/gc/lex.c
src/cmd/gc/lex.c
+5
-0
test/import5.go
test/import5.go
+11
-0
No files found.
src/cmd/gc/lex.c
View file @
33f3afa7
...
@@ -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
...
...
test/import5.go
0 → 100644
View file @
33f3afa7
// 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"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment