From daacba518425fe2dcbdfd89ff43f8ab11cdabea8 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 13 Mar 2012 15:35:08 +1100 Subject: [PATCH] gc: include full text of import path in error message R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/5783091 --- src/cmd/gc/subr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c index b26f1e32c00..22c371e5342 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; } }