mirror of
https://github.com/golang/go
synced 2024-11-19 17:14:44 -07:00
cmd/dist: fix bug in bsubst
R=golang-dev, r, dsymonds, akumar CC=golang-dev https://golang.org/cl/5624054
This commit is contained in:
parent
cdfd5b2bed
commit
c06bd52a2e
5
src/cmd/dist/buf.c
vendored
Normal file → Executable file
5
src/cmd/dist/buf.c
vendored
Normal file → Executable file
@ -115,8 +115,11 @@ bsubst(Buf *b, char *x, char *y)
|
||||
if(p == nil)
|
||||
break;
|
||||
if(nx != ny) {
|
||||
if(nx < ny)
|
||||
if(nx < ny) {
|
||||
pos = p - b->p;
|
||||
bgrow(b, ny-nx);
|
||||
p = b->p + pos;
|
||||
}
|
||||
xmemmove(p+ny, p+nx, (b->p+b->len)-(p+nx));
|
||||
}
|
||||
xmemmove(p, y, ny);
|
||||
|
Loading…
Reference in New Issue
Block a user