ted: replace magic number (077776, i.e. 32766) with NBLK-1. (#300) - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 3d08a066b167b60691949fe89a7a67ef29df39cb
 (DIR) parent 46606276c3fe20fa81597cf87378e18f7baf88a7
 (HTM) 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:
         M src/cmd/ed.c                        |       2 +-
       
       1 file changed, 1 insertion(+), 1 deletion(-)
       ---
 (DIR) diff --git a/src/cmd/ed.c b/src/cmd/ed.c
       t@@ -1050,7 +1050,7 @@ putline(void)
                        }
                }
                nl = tline;
       -        tline += ((lp-linebuf) + 03) & 077776;
       +        tline += ((lp-linebuf) + 03) & (NBLK-1);
                return nl;
        }