Skip to content

Commit dba926d

Browse files
committed
go/build: allow @ in #cgo directives for OS X
Fixes #13720. Change-Id: I2e48454696f37db419370630f913590c435cd9f0 Reviewed-on: https://go-review.googlesource.com/18331 Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Russ Cox <[email protected]>
1 parent bd70869 commit dba926d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/go/build/build.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,8 @@ func expandSrcDir(str string, srcdir string) (string, bool) {
12561256
// NOTE: $ is not safe for the shell, but it is allowed here because of linker options like -Wl,$ORIGIN.
12571257
// We never pass these arguments to a shell (just to programs we construct argv for), so this should be okay.
12581258
// See golang.org/issue/6038.
1259-
const safeString = "+-.,/0123456789=ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz:$"
1259+
// The @ is for OS X. See golang.org/issue/13720.
1260+
const safeString = "+-.,/0123456789=ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz:$@"
12601261
const safeSpaces = " "
12611262

12621263
var safeBytes = []byte(safeSpaces + safeString)

0 commit comments

Comments
 (0)