1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
|
--- a/main.c
+++ b/main.c
@@ -13,6 +13,9 @@
#include "config.h"
#include <signal.h>
#include <setjmp.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
#include "vi.h"
extern trapint(); /* defined below */
@@ -25,7 +28,7 @@ static init_digraphs();
/*---------------------------------------------------------------------*/
-void main(argc, argv)
+int main(argc, argv)
int argc;
char *argv[];
{
@@ -349,7 +352,7 @@ void main(argc, argv)
refresh();
endwin();
- exit(0);
+ return(0);
/*NOTREACHED*/
}
--- a/tio.c
+++ b/tio.c
@@ -15,6 +15,9 @@
# include <setjmp.h>
#endif
#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include "vi.h"
@@ -354,7 +357,7 @@ static int dummy()
return 0;
}
# else
-static int dummy()
+static void dummy()
{
}
# endif
--- a/tmp.c
+++ b/tmp.c
@@ -13,6 +13,9 @@
#include "config.h"
#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
#include "vi.h"
#if TOS
# include <stat.h>
@@ -24,7 +27,7 @@
# endif
#endif
#include <malloc.h>
-
+#include <string.h>
#ifndef NO_MODELINE
static void do_modeline(l, stop)
--- a/cmd1.c
+++ b/cmd1.c
@@ -14,6 +14,8 @@
#include "config.h"
#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
#include "vi.h"
#include "regexp.h"
@@ -278,7 +280,7 @@ void cmd_shell(frommark, tomark, cmd, ba
suspend_curses();
if (frommark == 0L)
{
- system(extra);
+ elvis_system(extra);
}
else /* pipe lines from the file through the command */
{
--- a/cmd2.c
+++ b/cmd2.c
@@ -11,6 +11,9 @@
/* This file contains some of the commands - mostly ones that change text */
#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include "config.h"
#include "vi.h"
#include "regexp.h"
@@ -23,7 +26,7 @@
# include <sys/stat.h>
# endif
#endif
-
+#include <string.h>
/*ARGSUSED*/
void cmd_substitute(frommark, tomark, cmd, bang, extra)
--- a/config.h
+++ b/config.h
@@ -148,7 +148,6 @@
#if BSD || UNIX7 || OSK
# define strchr index
#endif
-extern char *strchr();
/* BSD uses bcopy() instead of memcpy() */
#if BSD
@@ -219,6 +218,10 @@ extern char *malloc();
# endif
#endif
+#ifndef ANY_UNIX
+# define elvis_system system
+#endif
+
#if MSDOS || TOS
/* do not change TMPNAME, CUTNAME and SCRATCH*: they MUST begin with '%s\\'! */
# ifndef TMPDIR
--- a/curses.c
+++ b/curses.c
@@ -35,6 +35,8 @@
#endif
#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
extern char *getenv();
static void starttcap();
--- a/cut.c
+++ b/cut.c
@@ -20,6 +20,10 @@
#define rename(a,b) Frename(0,a,b)
#endif
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
# define NANNONS 9 /* number of annonymous buffers */
static struct cutbuf
--- a/ex.c
+++ b/ex.c
@@ -12,6 +12,7 @@
#include "config.h"
#include <ctype.h>
+#include <string.h>
#include "vi.h"
#ifndef isascii
--- a/input.c
+++ b/input.c
@@ -15,7 +15,7 @@
#include <ctype.h>
#include "config.h"
#include "vi.h"
-
+#include <string.h>
#ifndef NO_DIGRAPH
static struct _DIG
--- a/misc.c
+++ b/misc.c
@@ -12,6 +12,7 @@
#include "config.h"
#include "vi.h"
+#include <string.h>
/* find a particular line & return a pointer to a copy of its text */
--- a/modify.c
+++ b/modify.c
@@ -8,6 +8,7 @@
#include "config.h"
#include "vi.h"
+#include <string.h>
#ifdef DEBUG
# include <stdio.h>
--- a/move2.c
+++ b/move2.c
@@ -13,6 +13,7 @@
#include "config.h"
#include "vi.h"
#include "regexp.h"
+#include <stdlib.h>
extern long atol();
--- a/opts.c
+++ b/opts.c
@@ -14,6 +14,8 @@
#include "config.h"
#include "vi.h"
+#include <stdio.h>
+#include <string.h>
#ifndef NULL
#define NULL (char *)0
#endif
--- a/regexp.c
+++ b/regexp.c
@@ -31,6 +31,8 @@
#include <setjmp.h>
#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
#include "config.h"
#include "vi.h"
#include "regexp.h"
--- a/regsub.c
+++ b/regsub.c
@@ -5,6 +5,8 @@
*/
#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
#include "config.h"
#include "vi.h"
#include "regexp.h"
--- a/system.c
+++ b/system.c
@@ -25,6 +25,9 @@
#include <unistd.h>
#include <sys/types.h>
#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
extern char **environ;
#if ANY_UNIX
@@ -32,8 +35,8 @@ extern char **environ;
/* This is a new version of the system() function. The only difference
* between this one and the library one is: this one uses the o_shell option.
*/
-int system(cmd)
- char *cmd; /* a command to run */
+int elvis_system(char *cmd)
+/* char *cmd; a command to run */
{
int status; /* exit status of the command */
--- a/vcmd.c
+++ b/vcmd.c
@@ -13,6 +13,8 @@
#include "config.h"
#include "vi.h"
+#include <string.h>
+#include <stdio.h>
#if MSDOS
#include <process.h>
#include <string.h>
@@ -627,7 +629,7 @@ MARK v_keyword(keyword, m, cnt)
waswarn = *o_warn;
*o_warn = FALSE;
suspend_curses();
- if (system(cmdline))
+ if (elvis_system(cmdline))
{
addstr("<<< failed >>>\n");
}
--- a/vi.c
+++ b/vi.c
@@ -10,6 +10,7 @@
#include "config.h"
#include <ctype.h>
+#include <string.h>
#include "vi.h"
--- a/vi.h
+++ b/vi.h
@@ -409,6 +409,9 @@ typedef int CMD;
extern void ex();
extern void vi();
extern void doexcmd();
+#ifndef elvis_system
+extern int elvis_system(char *cmd);
+#endif
#ifndef NO_ABBR
extern void cmd_abbr();
|