mirror of https://github.com/golang/go.git
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
|
|
@ -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