Commit 779dfea4 authored by Russ Cox's avatar Russ Cox

gc: correct buffer size in sprint, add -L to show full paths

R=ken2
CC=golang-dev
https://golang.org/cl/2338041
parent bee2d5b0
...@@ -32,6 +32,8 @@ Flags: ...@@ -32,6 +32,8 @@ Flags:
output file, default 6.out for 6g, etc. output file, default 6.out for 6g, etc.
-e -e
normally the compiler quits after 10 errors; -e prints all errors normally the compiler quits after 10 errors; -e prints all errors
-L
show entire file path when printing line numbers in errors
-I dir1 -I dir2 -I dir1 -I dir2
add dir1 and dir2 to the list of paths to check for imported packages add dir1 and dir2 to the list of paths to check for imported packages
-N -N
......
...@@ -436,7 +436,9 @@ importfile(Val *f, int line) ...@@ -436,7 +436,9 @@ importfile(Val *f, int line)
path = f->u.sval; path = f->u.sval;
if(islocalname(path)) { if(islocalname(path)) {
cleanbuf = mal(strlen(pathname) + strlen(path->s) + 2); cleanbuf = mal(strlen(pathname) + strlen(path->s) + 2);
sprint(cleanbuf, "%s/%s", pathname, path->s); strcpy(cleanbuf, pathname);
strcat(cleanbuf, "/");
strcat(cleanbuf, path->s);
cleanname(cleanbuf); cleanname(cleanbuf);
path = strlit(cleanbuf); path = strlit(cleanbuf);
} }
......
...@@ -934,6 +934,8 @@ Lconv(Fmt *fp) ...@@ -934,6 +934,8 @@ Lconv(Fmt *fp)
break; break;
fmtprint(fp, " "); fmtprint(fp, " ");
} }
if(debug['L'])
fmtprint(fp, "%s/", pathname);
if(a[i].line) if(a[i].line)
fmtprint(fp, "%s:%ld[%s:%ld]", fmtprint(fp, "%s:%ld[%s:%ld]",
a[i].line->name, lno-a[i].ldel+1, a[i].line->name, lno-a[i].ldel+1,
......
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