aboutsummaryrefslogtreecommitdiff
path: root/networking/ipcalc.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-11-29 11:09:43 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-11-29 11:09:43 +0000
commitc61852a02bd2d61682235ba3185173f527313827 (patch)
tree6af2895da70dda926317fac31cd4db6a4b20200c /networking/ipcalc.c
parent601ae1378ba7bb59e9c1a19fcc4ddd7bf9fb2e1b (diff)
downloadbusybox-c61852a02bd2d61682235ba3185173f527313827.tar.gz
fix support for globally disabling --long-options.
(disabling them saves ~4K on fully configured bbox)
Diffstat (limited to 'networking/ipcalc.c')
-rw-r--r--networking/ipcalc.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/networking/ipcalc.c b/networking/ipcalc.c
index 909373cbb..0ee9646c2 100644
--- a/networking/ipcalc.c
+++ b/networking/ipcalc.c
@@ -64,19 +64,18 @@ int get_prefix(unsigned long netmask);
#if ENABLE_FEATURE_IPCALC_LONG_OPTIONS
static const struct option long_options[] = {
- {"netmask", no_argument, NULL, 'm'},
- {"broadcast", no_argument, NULL, 'b'},
- {"network", no_argument, NULL, 'n'},
-#ifdef CONFIG_FEATURE_IPCALC_FANCY
- {"prefix", no_argument, NULL, 'p'},
- {"hostname", no_argument, NULL, 'h'},
- {"silent", no_argument, NULL, 's'},
-#endif
- {NULL, 0, NULL, 0}
+ { "netmask", no_argument, NULL, 'm' },
+ { "broadcast", no_argument, NULL, 'b' },
+ { "network", no_argument, NULL, 'n' },
+# if ENABLE_FEATURE_IPCALC_FANCY
+ { "prefix", no_argument, NULL, 'p' },
+ { "hostname", no_argument, NULL, 'h' },
+ { "silent", no_argument, NULL, 's' },
+# endif
+ { NULL, 0, NULL, 0 }
};
-#else
-#define long_options 0
#endif
+
int ipcalc_main(int argc, char **argv)
{
unsigned opt;
@@ -85,9 +84,9 @@ int ipcalc_main(int argc, char **argv)
struct in_addr a;
char *ipstr;
- if (ENABLE_FEATURE_IPCALC_LONG_OPTIONS)
- applet_long_options = long_options;
-
+#if ENABLE_FEATURE_IPCALC_LONG_OPTIONS
+ applet_long_options = long_options;
+#endif
opt = getopt32(argc, argv, "mbn" USE_FEATURE_IPCALC_FANCY("phs"));
argc -= optind;
argv += optind;