aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-03-24 22:42:29 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-03-24 22:42:29 +0000
commit55f30b05ac6902ac17bad04f38fd4f381a8d75f7 (patch)
tree5b98c878f1634a2ba4d1a94ea4e58919667d26c4 /editors
parentc0415a983349dbd341c535991d948c2bead1ba0a (diff)
downloadbusybox-w32-55f30b05ac6902ac17bad04f38fd4f381a8d75f7.tar.gz
busybox-w32-55f30b05ac6902ac17bad04f38fd4f381a8d75f7.tar.bz2
busybox-w32-55f30b05ac6902ac17bad04f38fd4f381a8d75f7.zip
inetd,ed,msh: data/bss reduction (in mss, more than 9k of it)
Diffstat (limited to 'editors')
-rw-r--r--editors/ed.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/editors/ed.c b/editors/ed.c
index 42adca409..1706e4271 100644
--- a/editors/ed.c
+++ b/editors/ed.c
@@ -9,8 +9,12 @@
9 9
10#include "busybox.h" 10#include "busybox.h"
11 11
12#define USERSIZE 1024 /* max line length typed in by user */ 12enum {
13#define INITBUF_SIZE 1024 /* initial buffer size */ 13 USERSIZE = sizeof(bb_common_bufsiz1) > 1024 ? 1024
14 : sizeof(bb_common_bufsiz1) - 1, /* max line length typed in by user */
15 INITBUF_SIZE = 1024, /* initial buffer size */
16};
17
14typedef struct LINE { 18typedef struct LINE {
15 struct LINE *next; 19 struct LINE *next;
16 struct LINE *prev; 20 struct LINE *prev;
@@ -18,9 +22,11 @@ typedef struct LINE {
18 char data[1]; 22 char data[1];
19} LINE; 23} LINE;
20 24
25#define searchString bb_common_bufsiz1
26
21static LINE lines, *curLine; 27static LINE lines, *curLine;
22static int curNum, lastNum, marks[26], dirty; 28static int curNum, lastNum, marks[26], dirty;
23static char *bufBase, *bufPtr, *fileName, searchString[USERSIZE]; 29static char *bufBase, *bufPtr, *fileName;
24static int bufUsed, bufSize; 30static int bufUsed, bufSize;
25 31
26static void doCommands(void); 32static void doCommands(void);