diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-21 08:50:06 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-21 08:50:06 +0000 |
commit | 9924ce1cdcb6e4ab9635d6370ff7db6219c56094 (patch) | |
tree | 519c1bd5ff03997c9b11ceb7972da7467e44ea48 /editors/vi.c | |
parent | 80297d5f0cbe8a3de497804dcbb1a89e6f9c1562 (diff) | |
download | busybox-w32-1_8_3.tar.gz busybox-w32-1_8_3.tar.bz2 busybox-w32-1_8_3.zip |
apply four post-1.8.2 patches; bump to 1.8.31_8_3
Diffstat (limited to 'editors/vi.c')
-rw-r--r-- | editors/vi.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/editors/vi.c b/editors/vi.c index 345a9452d..9426ab855 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
@@ -184,6 +184,7 @@ struct globals { | |||
184 | #if ENABLE_FEATURE_VI_COLON | 184 | #if ENABLE_FEATURE_VI_COLON |
185 | char *initial_cmds[3]; // currently 2 entries, NULL terminated | 185 | char *initial_cmds[3]; // currently 2 entries, NULL terminated |
186 | #endif | 186 | #endif |
187 | char readbuffer[MAX_LINELEN]; | ||
187 | }; | 188 | }; |
188 | #define G (*ptr_to_globals) | 189 | #define G (*ptr_to_globals) |
189 | #define text (G.text ) | 190 | #define text (G.text ) |
@@ -200,6 +201,10 @@ struct globals { | |||
200 | #define term_orig (G.term_orig ) | 201 | #define term_orig (G.term_orig ) |
201 | #define term_vi (G.term_vi ) | 202 | #define term_vi (G.term_vi ) |
202 | #define initial_cmds (G.initial_cmds ) | 203 | #define initial_cmds (G.initial_cmds ) |
204 | #define readbuffer (G.readbuffer ) | ||
205 | #define INIT_G() do { \ | ||
206 | PTR_TO_GLOBALS = xzalloc(sizeof(G)); \ | ||
207 | } while (0) | ||
203 | 208 | ||
204 | static int init_text_buffer(char *); // init from file or create new | 209 | static int init_text_buffer(char *); // init from file or create new |
205 | static void edit_file(char *); // edit one file | 210 | static void edit_file(char *); // edit one file |
@@ -321,7 +326,7 @@ int vi_main(int argc, char **argv) | |||
321 | my_pid = getpid(); | 326 | my_pid = getpid(); |
322 | #endif | 327 | #endif |
323 | 328 | ||
324 | PTR_TO_GLOBALS = xzalloc(sizeof(G)); | 329 | INIT_G(); |
325 | 330 | ||
326 | #if ENABLE_FEATURE_VI_CRASHME | 331 | #if ENABLE_FEATURE_VI_CRASHME |
327 | srand((long) my_pid); | 332 | srand((long) my_pid); |
@@ -2142,8 +2147,6 @@ static int mysleep(int hund) // sleep for 'h' 1/100 seconds | |||
2142 | return safe_poll(pfd, 1, hund*10) > 0; | 2147 | return safe_poll(pfd, 1, hund*10) > 0; |
2143 | } | 2148 | } |
2144 | 2149 | ||
2145 | #define readbuffer bb_common_bufsiz1 | ||
2146 | |||
2147 | static int readed_for_parse; | 2150 | static int readed_for_parse; |
2148 | 2151 | ||
2149 | //----- IO Routines -------------------------------------------- | 2152 | //----- IO Routines -------------------------------------------- |