summaryrefslogtreecommitdiff
path: root/editors/ed.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-03-24 22:42:29 +0000
committerDenis Vlasenko2007-03-24 22:42:29 +0000
commit55f30b05ac6902ac17bad04f38fd4f381a8d75f7 (patch)
tree5b98c878f1634a2ba4d1a94ea4e58919667d26c4 /editors/ed.c
parentc0415a983349dbd341c535991d948c2bead1ba0a (diff)
downloadbusybox-55f30b05ac6902ac17bad04f38fd4f381a8d75f7.zip
busybox-55f30b05ac6902ac17bad04f38fd4f381a8d75f7.tar.gz
inetd,ed,msh: data/bss reduction (in mss, more than 9k of it)
Diffstat (limited to 'editors/ed.c')
-rw-r--r--editors/ed.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/editors/ed.c b/editors/ed.c
index 42adca4..1706e42 100644
--- a/editors/ed.c
+++ b/editors/ed.c
@@ -9,8 +9,12 @@
#include "busybox.h"
-#define USERSIZE 1024 /* max line length typed in by user */
-#define INITBUF_SIZE 1024 /* initial buffer size */
+enum {
+ USERSIZE = sizeof(bb_common_bufsiz1) > 1024 ? 1024
+ : sizeof(bb_common_bufsiz1) - 1, /* max line length typed in by user */
+ INITBUF_SIZE = 1024, /* initial buffer size */
+};
+
typedef struct LINE {
struct LINE *next;
struct LINE *prev;
@@ -18,9 +22,11 @@ typedef struct LINE {
char data[1];
} LINE;
+#define searchString bb_common_bufsiz1
+
static LINE lines, *curLine;
static int curNum, lastNum, marks[26], dirty;
-static char *bufBase, *bufPtr, *fileName, searchString[USERSIZE];
+static char *bufBase, *bufPtr, *fileName;
static int bufUsed, bufSize;
static void doCommands(void);