diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/diff.c | 1 | ||||
-rw-r--r-- | editors/ed.c | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/editors/diff.c b/editors/diff.c index 3c8e907..ff26936 100644 --- a/editors/diff.c +++ b/editors/diff.c @@ -749,6 +749,7 @@ static int diffreg(char *file[2]) fp[i] = fdopen(fd, "r"); } + setup_common_bufsiz(); while (1) { const size_t sz = COMMON_BUFSIZE / 2; char *const buf0 = bb_common_bufsiz1; diff --git a/editors/ed.c b/editors/ed.c index 8da7b1d..c028b78 100644 --- a/editors/ed.c +++ b/editors/ed.c @@ -33,12 +33,11 @@ typedef struct LINE { } LINE; -#define searchString bb_common_bufsiz1 -#define sizeof_searchString COMMON_BUFSIZE +#define searchString bb_common_bufsiz1 enum { - USERSIZE = sizeof_searchString > 1024 ? 1024 - : sizeof_searchString - 1, /* max line length typed in by user */ + USERSIZE = COMMON_BUFSIZE > 1024 ? 1024 + : COMMON_BUFSIZE - 1, /* max line length typed in by user */ INITBUF_SIZE = 1024, /* initial buffer size */ }; @@ -68,6 +67,7 @@ struct globals { #define lines (G.lines ) #define marks (G.marks ) #define INIT_G() do { \ + setup_common_bufsiz(); \ SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ } while (0) |