diff options
author | Rob Pike <r@golang.org> | 2012-03-13 15:35:08 +1100 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2012-03-13 15:35:08 +1100 |
commit | 9e7f75b8418d0d373531217ce93f832c7795def8 (patch) | |
tree | fee37658203e6f95632eb90ac9aee73a4c962af3 | |
parent | 1e67cddf963ef19400c5865b78db6e78a036dee4 (diff) | |
download | go-9e7f75b8418d0d373531217ce93f832c7795def8.tar.gz |
gc: include full text of import path in error message
R=golang-dev, dsymonds
CC=golang-dev
http://codereview.appspot.com/5783091
-rw-r--r-- | src/cmd/gc/subr.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c index b26f1e32c..22c371e53 100644 --- a/src/cmd/gc/subr.c +++ b/src/cmd/gc/subr.c @@ -3624,23 +3624,23 @@ isbadimport(Strlit *path) while(*s) { s += chartorune(&r, s); if(r == Runeerror) { - yyerror("import path contains invalid UTF-8 sequence"); + yyerror("import path contains invalid UTF-8 sequence: \"%s\"", path->s); return 1; } if(r < 0x20 || r == 0x7f) { - yyerror("import path contains control character"); + yyerror("import path contains control character: \"%s\"", path->s); return 1; } if(r == '\\') { - yyerror("import path contains backslash; use slash"); + yyerror("import path contains backslash; use slash: \"%s\"", path->s); return 1; } if(isspacerune(r)) { - yyerror("import path contains space character"); + yyerror("import path contains space character: \"%s\"", path->s); return 1; } if(utfrune("!\"#$%&'()*,:;<=>?[]^`{|}~", r)) { - yyerror("import path contains invalid character '%C'", r); + yyerror("import path contains invalid character '%C': \"%s\"", r, path->s); return 1; } } |