aboutsummaryrefslogtreecommitdiff
path: root/util-linux/getopt.c
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-03-10 19:22:06 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-03-10 19:22:06 +0000
commit07ea853040a1240d40fefe5bb871a5c3c98c77a6 (patch)
treebeb32cedafc6232bf8a49fe90f0769d471ea6791 /util-linux/getopt.c
parent8ee3984df387bf31ba1d652a861d7fedbac7bfa8 (diff)
downloadbusybox-w32-07ea853040a1240d40fefe5bb871a5c3c98c77a6.tar.gz
busybox-w32-07ea853040a1240d40fefe5bb871a5c3c98c77a6.tar.bz2
busybox-w32-07ea853040a1240d40fefe5bb871a5c3c98c77a6.zip
Patch from Denis Vlasenko turning static const int (which gets emitted into
the busybox binary) into enums (which don't). git-svn-id: svn://busybox.net/trunk/busybox@14513 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'util-linux/getopt.c')
-rw-r--r--util-linux/getopt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/util-linux/getopt.c b/util-linux/getopt.c
index 16dcbbca0..9e33b79bf 100644
--- a/util-linux/getopt.c
+++ b/util-linux/getopt.c
@@ -53,9 +53,11 @@
53 53
54/* NON_OPT is the code that is returned when a non-option is found in '+' 54/* NON_OPT is the code that is returned when a non-option is found in '+'
55 mode */ 55 mode */
56static const int NON_OPT = 1; 56enum {
57 NON_OPT = 1,
57/* LONG_OPT is the code that is returned when a long option is found. */ 58/* LONG_OPT is the code that is returned when a long option is found. */
58static const int LONG_OPT = 2; 59 LONG_OPT = 2
60};
59 61
60/* The shells recognized. */ 62/* The shells recognized. */
61typedef enum {BASH,TCSH} shell_t; 63typedef enum {BASH,TCSH} shell_t;
@@ -195,7 +197,7 @@ int generate_output(char * argv[],int argc,const char *optstr,
195static struct option *long_options; 197static struct option *long_options;
196static int long_options_length; /* Length of array */ 198static int long_options_length; /* Length of array */
197static int long_options_nr; /* Nr of used elements in array */ 199static int long_options_nr; /* Nr of used elements in array */
198static const int LONG_OPTIONS_INCR = 10; 200enum { LONG_OPTIONS_INCR = 10 };
199#define init_longopt() add_longopt(NULL,0) 201#define init_longopt() add_longopt(NULL,0)
200 202
201/* Register a long option. The contents of name is copied. */ 203/* Register a long option. The contents of name is copied. */