aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2005-12-13 10:48:45 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2005-12-13 10:48:45 +0000
commit5816ccb190e0ffc10d9f4da2f98a2cb0da6f6315 (patch)
tree785f8bc8cd9da5efeb82abd9b0315652164cebb1
parentec351c32e33517e103315927f694d43478c41f67 (diff)
downloadbusybox-w32-5816ccb190e0ffc10d9f4da2f98a2cb0da6f6315.tar.gz
busybox-w32-5816ccb190e0ffc10d9f4da2f98a2cb0da6f6315.tar.bz2
busybox-w32-5816ccb190e0ffc10d9f4da2f98a2cb0da6f6315.zip
- wrap label GET_COUNT in #if ENABLE_FEATURE_FANCY_applet to avoid warning
about unused label.
-rw-r--r--coreutils/head.c12
-rw-r--r--coreutils/tail.c6
2 files changed, 11 insertions, 7 deletions
diff --git a/coreutils/head.c b/coreutils/head.c
index a20873333..628dae5ea 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -33,7 +33,7 @@
33 33
34static const char head_opts[] = 34static const char head_opts[] =
35 "n:" 35 "n:"
36#ifdef CONFIG_FEATURE_FANCY_HEAD 36#if ENABLE_FEATURE_FANCY_HEAD
37 "c:qv" 37 "c:qv"
38#endif 38#endif
39 ; 39 ;
@@ -44,7 +44,7 @@ int head_main(int argc, char **argv)
44{ 44{
45 unsigned long count = 10; 45 unsigned long count = 10;
46 unsigned long i; 46 unsigned long i;
47#ifdef CONFIG_FEATURE_FANCY_HEAD 47#if ENABLE_FEATURE_FANCY_HEAD
48 int count_bytes = 0; 48 int count_bytes = 0;
49 int header_threshhold = 1; 49 int header_threshhold = 1;
50#endif 50#endif
@@ -56,7 +56,7 @@ int head_main(int argc, char **argv)
56 int c; 56 int c;
57 int retval = EXIT_SUCCESS; 57 int retval = EXIT_SUCCESS;
58 58
59#if defined CONFIG_FEATURE_SUSv2 || defined CONFIG_FEATURE_FANCY_HEAD 59#if defined CONFIG_FEATURE_SUSv2 || ENABLE_FEATURE_FANCY_HEAD
60 /* Allow legacy syntax of an initial numeric option without -n. */ 60 /* Allow legacy syntax of an initial numeric option without -n. */
61 if ((argc > 1) && (argv[1][0] == '-') 61 if ((argc > 1) && (argv[1][0] == '-')
62 /* && (isdigit)(argv[1][1]) */ 62 /* && (isdigit)(argv[1][1]) */
@@ -72,7 +72,7 @@ int head_main(int argc, char **argv)
72 /* No size benefit in converting this to bb_getopt_ulflags */ 72 /* No size benefit in converting this to bb_getopt_ulflags */
73 while ((opt = getopt(argc, argv, head_opts)) > 0) { 73 while ((opt = getopt(argc, argv, head_opts)) > 0) {
74 switch(opt) { 74 switch(opt) {
75#ifdef CONFIG_FEATURE_FANCY_HEAD 75#if ENABLE_FEATURE_FANCY_HEAD
76 case 'q': 76 case 'q':
77 header_threshhold = INT_MAX; 77 header_threshhold = INT_MAX;
78 break; 78 break;
@@ -85,7 +85,9 @@ int head_main(int argc, char **argv)
85#endif 85#endif
86 case 'n': 86 case 'n':
87 p = optarg; 87 p = optarg;
88#if ENABLE_FEATURE_FANCY_HEAD
88 GET_COUNT: 89 GET_COUNT:
90#endif
89 count = bb_xgetularg10(p); 91 count = bb_xgetularg10(p);
90 break; 92 break;
91 default: 93 default:
@@ -99,7 +101,7 @@ int head_main(int argc, char **argv)
99 } 101 }
100 102
101 fmt = header_fmt_str + 1; 103 fmt = header_fmt_str + 1;
102#ifdef CONFIG_FEATURE_FANCY_HEAD 104#if ENABLE_FEATURE_FANCY_HEAD
103 if (argc - optind <= header_threshhold) { 105 if (argc - optind <= header_threshhold) {
104 header_threshhold = 0; 106 header_threshhold = 0;
105 } 107 }
diff --git a/coreutils/tail.c b/coreutils/tail.c
index cc1517a7e..bda8ae04f 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -96,7 +96,7 @@ static ssize_t tail_read(int fd, char *buf, size_t count)
96 96
97static const char tail_opts[] = 97static const char tail_opts[] =
98 "fn:c:" 98 "fn:c:"
99#ifdef CONFIG_FEATURE_FANCY_TAIL 99#if ENABLE_FEATURE_FANCY_TAIL
100 "qs:v" 100 "qs:v"
101#endif 101#endif
102 ; 102 ;
@@ -142,7 +142,9 @@ int tail_main(int argc, char **argv)
142 count_bytes = 1; 142 count_bytes = 1;
143 /* FALLS THROUGH */ 143 /* FALLS THROUGH */
144 case 'n': 144 case 'n':
145#if ENABLE_FEATURE_FANCY_TAIL
145 GET_COUNT: 146 GET_COUNT:
147#endif
146 count = bb_xgetlarg10_sfx(optarg, tail_suffixes); 148 count = bb_xgetlarg10_sfx(optarg, tail_suffixes);
147 /* Note: Leading whitespace is an error trapped above. */ 149 /* Note: Leading whitespace is an error trapped above. */
148 if (*optarg == '+') { 150 if (*optarg == '+') {
@@ -154,7 +156,7 @@ int tail_main(int argc, char **argv)
154 count = -count; 156 count = -count;
155 } 157 }
156 break; 158 break;
157#ifdef CONFIG_FEATURE_FANCY_TAIL 159#if ENABLE_FEATURE_FANCY_TAIL
158 case 'q': 160 case 'q':
159 header_threshhold = INT_MAX; 161 header_threshhold = INT_MAX;
160 break; 162 break;