commit 3d08a066b167b60691949fe89a7a67ef29df39cb
parent 46606276c3fe20fa81597cf87378e18f7baf88a7
Author: Marc Simpson <marc@0branch.com>
Date: Sun, 8 Dec 2019 17:19:17 -0800
ed: replace magic number (077776, i.e. 32766) with NBLK-1. (#300)
Temp file size is now declared in an enum; changing it from the
default introduces a subtle bug in putline(), which expects it to
be 32767.
Mask with NBLK-1 instead.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cmd/ed.c b/src/cmd/ed.c
@@ -1050,7 +1050,7 @@ putline(void)
}
}
nl = tline;
- tline += ((lp-linebuf) + 03) & 077776;
+ tline += ((lp-linebuf) + 03) & (NBLK-1);
return nl;
}