aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-03-22 22:22:10 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-03-22 22:22:10 +0000
commitdd92d7052a48feff1b63d68e4ade691d3fd70320 (patch)
treed28f81d979f0c9fedf630b8bb0af27145bc1b72d
parent724dbda07e0e7bf89317198323f4973ec0510844 (diff)
downloadbusybox-w32-dd92d7052a48feff1b63d68e4ade691d3fd70320.tar.gz
busybox-w32-dd92d7052a48feff1b63d68e4ade691d3fd70320.tar.bz2
busybox-w32-dd92d7052a48feff1b63d68e4ade691d3fd70320.zip
assorted fixes uncovered by randomconfig runs
git-svn-id: svn://busybox.net/trunk/busybox@18209 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--editors/vi.c12
-rw-r--r--networking/ifconfig.c3
-rw-r--r--util-linux/fdisk.c2
3 files changed, 15 insertions, 2 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 863735e31..853303249 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -260,7 +260,9 @@ static void crash_dummy();
260static void crash_test(); 260static void crash_test();
261static int crashme = 0; 261static int crashme = 0;
262#endif 262#endif
263#if ENABLE_FEATURE_VI_COLON
263static char *initial_cmds[] = { NULL, NULL , NULL }; // currently 2 entries, NULL terminated 264static char *initial_cmds[] = { NULL, NULL , NULL }; // currently 2 entries, NULL terminated
265#endif
264 266
265 267
266static void write1(const char *out) 268static void write1(const char *out)
@@ -307,12 +309,14 @@ int vi_main(int argc, char **argv)
307 // 1- process $HOME/.exrc file (not inplemented yet) 309 // 1- process $HOME/.exrc file (not inplemented yet)
308 // 2- process EXINIT variable from environment 310 // 2- process EXINIT variable from environment
309 // 3- process command line args 311 // 3- process command line args
312#if ENABLE_FEATURE_VI_COLON
310 { 313 {
311 char *p = getenv("EXINIT"); 314 char *p = getenv("EXINIT");
312 if (p && *p) 315 if (p && *p)
313 initial_cmds[0] = xstrdup(p); 316 initial_cmds[0] = xstrdup(p);
314 } 317 }
315 while ((c = getopt(argc, argv, "hCRc:")) != -1) { 318#endif
319 while ((c = getopt(argc, argv, "hCR" USE_FEATURE_VI_COLON("c:"))) != -1) {
316 switch (c) { 320 switch (c) {
317#if ENABLE_FEATURE_VI_CRASHME 321#if ENABLE_FEATURE_VI_CRASHME
318 case 'C': 322 case 'C':
@@ -328,11 +332,13 @@ int vi_main(int argc, char **argv)
328 //case 'r': // recover flag- ignore- we don't use tmp file 332 //case 'r': // recover flag- ignore- we don't use tmp file
329 //case 'x': // encryption flag- ignore 333 //case 'x': // encryption flag- ignore
330 //case 'c': // execute command first 334 //case 'c': // execute command first
335#if ENABLE_FEATURE_VI_COLON
331 case 'c': // cmd line vi command 336 case 'c': // cmd line vi command
332 if (*optarg) 337 if (*optarg)
333 initial_cmds[initial_cmds[0] != 0] = xstrdup(optarg); 338 initial_cmds[initial_cmds[0] != 0] = xstrdup(optarg);
334 break; 339 break;
335 //case 'h': // help -- just use default 340 //case 'h': // help -- just use default
341#endif
336 default: 342 default:
337 show_help(); 343 show_help();
338 return 1; 344 return 1;
@@ -431,6 +437,7 @@ static void edit_file(char * fn)
431 redraw(FALSE); // dont force every col re-draw 437 redraw(FALSE); // dont force every col re-draw
432 show_status_line(); 438 show_status_line();
433 439
440#if ENABLE_FEATURE_VI_COLON
434 { 441 {
435 char *p, *q; 442 char *p, *q;
436 int n = 0; 443 int n = 0;
@@ -450,6 +457,7 @@ static void edit_file(char * fn)
450 n++; 457 n++;
451 } 458 }
452 } 459 }
460#endif
453 //------This is the main Vi cmd handling loop ----------------------- 461 //------This is the main Vi cmd handling loop -----------------------
454 while (editing > 0) { 462 while (editing > 0) {
455#if ENABLE_FEATURE_VI_CRASHME 463#if ENABLE_FEATURE_VI_CRASHME
@@ -938,7 +946,9 @@ static void colon(char * buf)
938 } 946 }
939#if ENABLE_FEATURE_VI_SET 947#if ENABLE_FEATURE_VI_SET
940 } else if (strncasecmp(cmd, "set", i) == 0) { // set or clear features 948 } else if (strncasecmp(cmd, "set", i) == 0) { // set or clear features
949#if ENABLE_FEATURE_VI_SETOPTS
941 char *argp; 950 char *argp;
951#endif
942 i = 0; // offset into args 952 i = 0; // offset into args
943 // only blank is regarded as args delmiter. What about tab '\t' ? 953 // only blank is regarded as args delmiter. What about tab '\t' ?
944 if (!args[0] || strcasecmp(args, "all") == 0) { 954 if (!args[0] || strcasecmp(args, "all") == 0) {
diff --git a/networking/ifconfig.c b/networking/ifconfig.c
index 96af7b770..3dcc902ca 100644
--- a/networking/ifconfig.c
+++ b/networking/ifconfig.c
@@ -387,9 +387,10 @@ int ifconfig_main(int argc, char **argv)
387 } 387 }
388#endif 388#endif
389 else { 389 else {
390 len_and_sockaddr *lsa;
390 if (strcmp(host, "inet") == 0) 391 if (strcmp(host, "inet") == 0)
391 continue; /* compat stuff */ 392 continue; /* compat stuff */
392 len_and_sockaddr *lsa = xhost2sockaddr(host, 0); 393 lsa = xhost2sockaddr(host, 0);
393#if ENABLE_FEATURE_IPV6 394#if ENABLE_FEATURE_IPV6
394 if (lsa->sa.sa_family == AF_INET6) { 395 if (lsa->sa.sa_family == AF_INET6) {
395 int sockfd6; 396 int sockfd6;
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c
index 9d7bd4e2c..f3c7ca4c6 100644
--- a/util-linux/fdisk.c
+++ b/util-linux/fdisk.c
@@ -325,6 +325,7 @@ struct globals {
325 s |= (sector >> 2) & 0xc0; \ 325 s |= (sector >> 2) & 0xc0; \
326 } while (0) 326 } while (0)
327 327
328#if ENABLE_FEATURE_FDISK_WRITABLE
328/* read line; return 0 or first printable char */ 329/* read line; return 0 or first printable char */
329static int 330static int
330read_line(const char *prompt) 331read_line(const char *prompt)
@@ -343,6 +344,7 @@ read_line(const char *prompt)
343 line_ptr++; 344 line_ptr++;
344 return *line_ptr; 345 return *line_ptr;
345} 346}
347#endif
346 348
347/* 349/*
348 * return partition name - uses static storage 350 * return partition name - uses static storage