svn commit: trunk/busybox: editors networking util-linux
vda at busybox.net
vda at busybox.net
Thu Mar 22 22:22:11 UTC 2007
Author: vda
Date: 2007-03-22 15:22:10 -0700 (Thu, 22 Mar 2007)
New Revision: 18209
Log:
assorted fixes uncovered by randomconfig runs
Modified:
trunk/busybox/editors/vi.c
trunk/busybox/networking/ifconfig.c
trunk/busybox/util-linux/fdisk.c
Changeset:
Modified: trunk/busybox/editors/vi.c
===================================================================
--- trunk/busybox/editors/vi.c 2007-03-22 19:35:51 UTC (rev 18208)
+++ trunk/busybox/editors/vi.c 2007-03-22 22:22:10 UTC (rev 18209)
@@ -260,7 +260,9 @@
static void crash_test();
static int crashme = 0;
#endif
+#if ENABLE_FEATURE_VI_COLON
static char *initial_cmds[] = { NULL, NULL , NULL }; // currently 2 entries, NULL terminated
+#endif
static void write1(const char *out)
@@ -307,12 +309,14 @@
// 1- process $HOME/.exrc file (not inplemented yet)
// 2- process EXINIT variable from environment
// 3- process command line args
+#if ENABLE_FEATURE_VI_COLON
{
char *p = getenv("EXINIT");
if (p && *p)
initial_cmds[0] = xstrdup(p);
}
- while ((c = getopt(argc, argv, "hCRc:")) != -1) {
+#endif
+ while ((c = getopt(argc, argv, "hCR" USE_FEATURE_VI_COLON("c:"))) != -1) {
switch (c) {
#if ENABLE_FEATURE_VI_CRASHME
case 'C':
@@ -328,11 +332,13 @@
//case 'r': // recover flag- ignore- we don't use tmp file
//case 'x': // encryption flag- ignore
//case 'c': // execute command first
+#if ENABLE_FEATURE_VI_COLON
case 'c': // cmd line vi command
if (*optarg)
initial_cmds[initial_cmds[0] != 0] = xstrdup(optarg);
break;
//case 'h': // help -- just use default
+#endif
default:
show_help();
return 1;
@@ -431,6 +437,7 @@
redraw(FALSE); // dont force every col re-draw
show_status_line();
+#if ENABLE_FEATURE_VI_COLON
{
char *p, *q;
int n = 0;
@@ -450,6 +457,7 @@
n++;
}
}
+#endif
//------This is the main Vi cmd handling loop -----------------------
while (editing > 0) {
#if ENABLE_FEATURE_VI_CRASHME
@@ -938,7 +946,9 @@
}
#if ENABLE_FEATURE_VI_SET
} else if (strncasecmp(cmd, "set", i) == 0) { // set or clear features
+#if ENABLE_FEATURE_VI_SETOPTS
char *argp;
+#endif
i = 0; // offset into args
// only blank is regarded as args delmiter. What about tab '\t' ?
if (!args[0] || strcasecmp(args, "all") == 0) {
Modified: trunk/busybox/networking/ifconfig.c
===================================================================
--- trunk/busybox/networking/ifconfig.c 2007-03-22 19:35:51 UTC (rev 18208)
+++ trunk/busybox/networking/ifconfig.c 2007-03-22 22:22:10 UTC (rev 18209)
@@ -387,9 +387,10 @@
}
#endif
else {
+ len_and_sockaddr *lsa;
if (strcmp(host, "inet") == 0)
continue; /* compat stuff */
- len_and_sockaddr *lsa = xhost2sockaddr(host, 0);
+ lsa = xhost2sockaddr(host, 0);
#if ENABLE_FEATURE_IPV6
if (lsa->sa.sa_family == AF_INET6) {
int sockfd6;
Modified: trunk/busybox/util-linux/fdisk.c
===================================================================
--- trunk/busybox/util-linux/fdisk.c 2007-03-22 19:35:51 UTC (rev 18208)
+++ trunk/busybox/util-linux/fdisk.c 2007-03-22 22:22:10 UTC (rev 18209)
@@ -325,6 +325,7 @@
s |= (sector >> 2) & 0xc0; \
} while (0)
+#if ENABLE_FEATURE_FDISK_WRITABLE
/* read line; return 0 or first printable char */
static int
read_line(const char *prompt)
@@ -343,6 +344,7 @@
line_ptr++;
return *line_ptr;
}
+#endif
/*
* return partition name - uses static storage
More information about the busybox-cvs
mailing list