summaryrefslogtreecommitdiff
path: root/editors/vi.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-04-04 19:29:48 +0000
committerEric Andersen <andersen@codepoet.org>2001-04-04 19:29:48 +0000
commitd402edfd6351380592366feb9e0accbe71cb9d9c (patch)
treea1446492a18430ec7a448b4c7a12c3a66e0fe776 /editors/vi.c
parent14fe392dded5e84a7ba8d8b5148b4d4a58a17e18 (diff)
downloadbusybox-w32-d402edfd6351380592366feb9e0accbe71cb9d9c.tar.gz
busybox-w32-d402edfd6351380592366feb9e0accbe71cb9d9c.tar.bz2
busybox-w32-d402edfd6351380592366feb9e0accbe71cb9d9c.zip
Some cleanups for libc5 support
Diffstat (limited to 'editors/vi.c')
-rw-r--r--editors/vi.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 325ab3436..07dccb611 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -19,13 +19,13 @@
19 */ 19 */
20 20
21char *vi_Version = 21char *vi_Version =
22 "$Id: vi.c,v 1.1 2001/04/04 17:31:15 andersen Exp $"; 22 "$Id: vi.c,v 1.2 2001/04/04 19:29:48 andersen Exp $";
23 23
24/* 24/*
25 * To compile for standalone use: 25 * To compile for standalone use:
26 * gcc -Wall -Os -DSTANDALONE -o vi vi.c 26 * gcc -Wall -Os -s -DSTANDALONE -o vi vi.c
27 * or 27 * or
28 * gcc -Wall -Os -DSTANDALONE -DCRASHME -o vi vi.c # include testing features 28 * gcc -Wall -Os -s -DSTANDALONE -DCRASHME -o vi vi.c # include testing features
29 * strip vi 29 * strip vi
30 */ 30 */
31 31
@@ -43,6 +43,7 @@ char *vi_Version =
43 43
44//---- Feature -------------- Bytes to immplement 44//---- Feature -------------- Bytes to immplement
45#ifdef STANDALONE 45#ifdef STANDALONE
46#define vi_main main
46#define BB_FEATURE_VI_COLON // 4288 47#define BB_FEATURE_VI_COLON // 4288
47#define BB_FEATURE_VI_YANKMARK // 1408 48#define BB_FEATURE_VI_YANKMARK // 1408
48#define BB_FEATURE_VI_SEARCH // 1088 49#define BB_FEATURE_VI_SEARCH // 1088
@@ -81,15 +82,6 @@ char *vi_Version =
81#include <assert.h> 82#include <assert.h>
82#include <errno.h> 83#include <errno.h>
83#include <stdarg.h> 84#include <stdarg.h>
84#ifdef __linux__
85#include <stdint.h> // INT32_MAX
86#else /* __linux__ */
87#include <values.h>
88extern int strncasecmp(const char *s1, const char *s2, size_t n);
89
90#define INT32_MAX MAXINT
91#include <libgen.h> //
92#endif /* __linux__ */
93 85
94#ifndef TRUE 86#ifndef TRUE
95#define TRUE ((int)1) 87#define TRUE ((int)1)
@@ -302,14 +294,10 @@ static int crashme = 0;
302#endif /* BB_FEATURE_VI_CRASHME */ 294#endif /* BB_FEATURE_VI_CRASHME */
303 295
304 296
305#ifdef STANDALONE
306int main(int argc, char **argv)
307#else
308extern int vi_main(int argc, char **argv) 297extern int vi_main(int argc, char **argv)
309#endif /* STANDALONE */
310{ 298{
311 extern char *optarg; 299 extern char *optarg;
312 char c; 300 int c;
313 301
314#ifdef BB_FEATURE_VI_YANKMARK 302#ifdef BB_FEATURE_VI_YANKMARK
315 int i; 303 int i;
@@ -448,7 +436,9 @@ static void edit_file(Byte * fn)
448 signal(SIGFPE, core_sig); 436 signal(SIGFPE, core_sig);
449 signal(SIGBUS, core_sig); 437 signal(SIGBUS, core_sig);
450 signal(SIGSEGV, core_sig); 438 signal(SIGSEGV, core_sig);
439#ifdef SIGSYS
451 signal(SIGSYS, core_sig); 440 signal(SIGSYS, core_sig);
441#endif
452 signal(SIGWINCH, winch_sig); 442 signal(SIGWINCH, winch_sig);
453 signal(SIGTSTP, suspend_sig); 443 signal(SIGTSTP, suspend_sig);
454 sig = setjmp(restart); 444 sig = setjmp(restart);
@@ -3100,7 +3090,9 @@ static void core_sig(int sig)
3100 signal(SIGFPE, core_sig); 3090 signal(SIGFPE, core_sig);
3101 signal(SIGBUS, core_sig); 3091 signal(SIGBUS, core_sig);
3102 signal(SIGSEGV, core_sig); 3092 signal(SIGSEGV, core_sig);
3093#ifdef SIGSYS
3103 signal(SIGSYS, core_sig); 3094 signal(SIGSYS, core_sig);
3095#endif
3104 3096
3105 dot = bound_dot(dot); // make sure "dot" is valid 3097 dot = bound_dot(dot); // make sure "dot" is valid
3106 3098