aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-04-21 11:09:40 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-04-21 11:09:40 +0000
commit5e34ff29bcc870936ab18172f438a34d042d4e03 (patch)
treea5e7a528f2f916eb883f1161eadceacdf2dca4be /shell
parent8b814b4a349e2262c0ad25793b05206a14651ebb (diff)
downloadbusybox-w32-5e34ff29bcc870936ab18172f438a34d042d4e03.tar.gz
busybox-w32-5e34ff29bcc870936ab18172f438a34d042d4e03.tar.bz2
busybox-w32-5e34ff29bcc870936ab18172f438a34d042d4e03.zip
*: mass renaming of USE_XXXX to IF_XXXX
and SKIP_XXXX to IF_NOT_XXXX - the second one was especially badly named. It was not skipping anything!
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c40
-rw-r--r--shell/hush.c22
2 files changed, 31 insertions, 31 deletions
diff --git a/shell/ash.c b/shell/ash.c
index c53b080a4..b27b2777e 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -56,11 +56,11 @@
56/* STANDALONE does not make sense, and won't compile */ 56/* STANDALONE does not make sense, and won't compile */
57#undef CONFIG_FEATURE_SH_STANDALONE 57#undef CONFIG_FEATURE_SH_STANDALONE
58#undef ENABLE_FEATURE_SH_STANDALONE 58#undef ENABLE_FEATURE_SH_STANDALONE
59#undef USE_FEATURE_SH_STANDALONE 59#undef IF_FEATURE_SH_STANDALONE
60#undef SKIP_FEATURE_SH_STANDALONE(...) 60#undef IF_NOT_FEATURE_SH_STANDALONE(...)
61#define ENABLE_FEATURE_SH_STANDALONE 0 61#define ENABLE_FEATURE_SH_STANDALONE 0
62#define USE_FEATURE_SH_STANDALONE(...) 62#define IF_FEATURE_SH_STANDALONE(...)
63#define SKIP_FEATURE_SH_STANDALONE(...) __VA_ARGS__ 63#define IF_NOT_FEATURE_SH_STANDALONE(...) __VA_ARGS__
64#endif 64#endif
65 65
66#ifndef PIPE_BUF 66#ifndef PIPE_BUF
@@ -349,7 +349,7 @@ raise_interrupt(void)
349} while (0) 349} while (0)
350#endif 350#endif
351 351
352static USE_ASH_OPTIMIZE_FOR_SIZE(inline) void 352static IF_ASH_OPTIMIZE_FOR_SIZE(inline) void
353int_on(void) 353int_on(void)
354{ 354{
355 xbarrier(); 355 xbarrier();
@@ -358,7 +358,7 @@ int_on(void)
358 } 358 }
359} 359}
360#define INT_ON int_on() 360#define INT_ON int_on()
361static USE_ASH_OPTIMIZE_FOR_SIZE(inline) void 361static IF_ASH_OPTIMIZE_FOR_SIZE(inline) void
362force_int_on(void) 362force_int_on(void)
363{ 363{
364 xbarrier(); 364 xbarrier();
@@ -4219,7 +4219,7 @@ cmdputs(const char *s)
4219 static const char vstype[VSTYPE + 1][3] = { 4219 static const char vstype[VSTYPE + 1][3] = {
4220 "", "}", "-", "+", "?", "=", 4220 "", "}", "-", "+", "?", "=",
4221 "%", "%%", "#", "##" 4221 "%", "%%", "#", "##"
4222 USE_ASH_BASH_COMPAT(, ":", "/", "//") 4222 IF_ASH_BASH_COMPAT(, ":", "/", "//")
4223 }; 4223 };
4224 4224
4225 const char *p, *str; 4225 const char *p, *str;
@@ -6069,9 +6069,9 @@ subevalvar(char *p, char *str, int strloc, int subtype,
6069 char *startp; 6069 char *startp;
6070 char *loc; 6070 char *loc;
6071 char *rmesc, *rmescend; 6071 char *rmesc, *rmescend;
6072 USE_ASH_BASH_COMPAT(char *repl = NULL;) 6072 IF_ASH_BASH_COMPAT(char *repl = NULL;)
6073 USE_ASH_BASH_COMPAT(char null = '\0';) 6073 IF_ASH_BASH_COMPAT(char null = '\0';)
6074 USE_ASH_BASH_COMPAT(int pos, len, orig_len;) 6074 IF_ASH_BASH_COMPAT(int pos, len, orig_len;)
6075 int saveherefd = herefd; 6075 int saveherefd = herefd;
6076 int amount, workloc, resetloc; 6076 int amount, workloc, resetloc;
6077 int zero; 6077 int zero;
@@ -6157,7 +6157,7 @@ subevalvar(char *p, char *str, int strloc, int subtype,
6157 * stack will need rebasing, and we'll need to remove our work 6157 * stack will need rebasing, and we'll need to remove our work
6158 * areas each time 6158 * areas each time
6159 */ 6159 */
6160 USE_ASH_BASH_COMPAT(restart:) 6160 IF_ASH_BASH_COMPAT(restart:)
6161 6161
6162 amount = expdest - ((char *)stackblock() + resetloc); 6162 amount = expdest - ((char *)stackblock() + resetloc);
6163 STADJUST(-amount, expdest); 6163 STADJUST(-amount, expdest);
@@ -7083,7 +7083,7 @@ static int builtinloc = -1; /* index in path of %builtin, or -1 */
7083 7083
7084 7084
7085static void 7085static void
7086tryexec(USE_FEATURE_SH_STANDALONE(int applet_no,) char *cmd, char **argv, char **envp) 7086tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) char *cmd, char **argv, char **envp)
7087{ 7087{
7088 int repeated = 0; 7088 int repeated = 0;
7089 7089
@@ -7155,13 +7155,13 @@ shellexec(char **argv, const char *path, int idx)
7155 || (applet_no = find_applet_by_name(argv[0])) >= 0 7155 || (applet_no = find_applet_by_name(argv[0])) >= 0
7156#endif 7156#endif
7157 ) { 7157 ) {
7158 tryexec(USE_FEATURE_SH_STANDALONE(applet_no,) argv[0], argv, envp); 7158 tryexec(IF_FEATURE_SH_STANDALONE(applet_no,) argv[0], argv, envp);
7159 e = errno; 7159 e = errno;
7160 } else { 7160 } else {
7161 e = ENOENT; 7161 e = ENOENT;
7162 while ((cmdname = padvance(&path, argv[0])) != NULL) { 7162 while ((cmdname = padvance(&path, argv[0])) != NULL) {
7163 if (--idx < 0 && pathopt == NULL) { 7163 if (--idx < 0 && pathopt == NULL) {
7164 tryexec(USE_FEATURE_SH_STANDALONE(-1,) cmdname, argv, envp); 7164 tryexec(IF_FEATURE_SH_STANDALONE(-1,) cmdname, argv, envp);
7165 if (errno != ENOENT && errno != ENOTDIR) 7165 if (errno != ENOENT && errno != ENOTDIR)
7166 e = errno; 7166 e = errno;
7167 } 7167 }
@@ -10789,7 +10789,7 @@ readtoken1(int firstc, int syntax, char *eofmark, int striptabs)
10789 int parenlevel; /* levels of parens in arithmetic */ 10789 int parenlevel; /* levels of parens in arithmetic */
10790 int dqvarnest; /* levels of variables expansion within double quotes */ 10790 int dqvarnest; /* levels of variables expansion within double quotes */
10791 10791
10792 USE_ASH_BASH_COMPAT(smallint bash_dollar_squote = 0;) 10792 IF_ASH_BASH_COMPAT(smallint bash_dollar_squote = 0;)
10793 10793
10794#if __GNUC__ 10794#if __GNUC__
10795 /* Avoid longjmp clobbering */ 10795 /* Avoid longjmp clobbering */
@@ -10895,7 +10895,7 @@ readtoken1(int firstc, int syntax, char *eofmark, int striptabs)
10895 dblquote = 1; 10895 dblquote = 1;
10896 goto quotemark; 10896 goto quotemark;
10897 case CENDQUOTE: 10897 case CENDQUOTE:
10898 USE_ASH_BASH_COMPAT(bash_dollar_squote = 0;) 10898 IF_ASH_BASH_COMPAT(bash_dollar_squote = 0;)
10899 if (eofmark != NULL && arinest == 0 10899 if (eofmark != NULL && arinest == 0
10900 && varnest == 0 10900 && varnest == 0
10901 ) { 10901 ) {
@@ -10994,7 +10994,7 @@ readtoken1(int firstc, int syntax, char *eofmark, int striptabs)
10994 len = out - (char *)stackblock(); 10994 len = out - (char *)stackblock();
10995 out = stackblock(); 10995 out = stackblock();
10996 if (eofmark == NULL) { 10996 if (eofmark == NULL) {
10997 if ((c == '>' || c == '<' USE_ASH_BASH_COMPAT( || c == 0x100 + '>')) 10997 if ((c == '>' || c == '<' IF_ASH_BASH_COMPAT( || c == 0x100 + '>'))
10998 && quotef == 0 10998 && quotef == 0
10999 ) { 10999 ) {
11000 if (isdigit_str9(out)) { 11000 if (isdigit_str9(out)) {
@@ -11488,7 +11488,7 @@ xxreadtoken(void)
11488 startlinno = g_parsefile->linno; 11488 startlinno = g_parsefile->linno;
11489 for (;;) { /* until token or start of word found */ 11489 for (;;) { /* until token or start of word found */
11490 c = pgetc_fast(); 11490 c = pgetc_fast();
11491 if (c == ' ' || c == '\t' USE_ASH_ALIAS( || c == PEOA)) 11491 if (c == ' ' || c == '\t' IF_ASH_ALIAS( || c == PEOA))
11492 continue; 11492 continue;
11493 11493
11494 if (c == '#') { 11494 if (c == '#') {
@@ -12454,8 +12454,8 @@ readcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
12454 rflag = 0; 12454 rflag = 0;
12455 prompt = NULL; 12455 prompt = NULL;
12456 while ((i = nextopt("p:u:r" 12456 while ((i = nextopt("p:u:r"
12457 USE_ASH_READ_TIMEOUT("t:") 12457 IF_ASH_READ_TIMEOUT("t:")
12458 USE_ASH_READ_NCHARS("n:s") 12458 IF_ASH_READ_NCHARS("n:s")
12459 )) != '\0') { 12459 )) != '\0') {
12460 switch (i) { 12460 switch (i) {
12461 case 'p': 12461 case 'p':
diff --git a/shell/hush.c b/shell/hush.c
index d59a5de82..58a57d961 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -97,11 +97,11 @@
97/* STANDALONE does not make sense, and won't compile */ 97/* STANDALONE does not make sense, and won't compile */
98# undef CONFIG_FEATURE_SH_STANDALONE 98# undef CONFIG_FEATURE_SH_STANDALONE
99# undef ENABLE_FEATURE_SH_STANDALONE 99# undef ENABLE_FEATURE_SH_STANDALONE
100# undef USE_FEATURE_SH_STANDALONE 100# undef IF_FEATURE_SH_STANDALONE
101# define SKIP_FEATURE_SH_STANDALONE(...) __VA_ARGS__ 101# define IF_NOT_FEATURE_SH_STANDALONE(...) __VA_ARGS__
102# define ENABLE_FEATURE_SH_STANDALONE 0 102# define ENABLE_FEATURE_SH_STANDALONE 0
103# define USE_FEATURE_SH_STANDALONE(...) 103# define IF_FEATURE_SH_STANDALONE(...)
104# define SKIP_FEATURE_SH_STANDALONE(...) __VA_ARGS__ 104# define IF_NOT_FEATURE_SH_STANDALONE(...) __VA_ARGS__
105#endif 105#endif
106 106
107#if !ENABLE_HUSH_INTERACTIVE 107#if !ENABLE_HUSH_INTERACTIVE
@@ -2443,11 +2443,11 @@ static void re_execute_shell(char ***to_free, const char *s, char *g_argv0, char
2443 goto do_exec; 2443 goto do_exec;
2444 } 2444 }
2445 2445
2446 sprintf(param_buf, "-$%x:%x:%x" USE_HUSH_LOOPS(":%x") 2446 sprintf(param_buf, "-$%x:%x:%x" IF_HUSH_LOOPS(":%x")
2447 , (unsigned) G.root_pid 2447 , (unsigned) G.root_pid
2448 , (unsigned) G.last_bg_pid 2448 , (unsigned) G.last_bg_pid
2449 , (unsigned) G.last_exitcode 2449 , (unsigned) G.last_exitcode
2450 USE_HUSH_LOOPS(, G.depth_of_loop) 2450 IF_HUSH_LOOPS(, G.depth_of_loop)
2451 ); 2451 );
2452 /* 1:hush 2:-$<pid>:<pid>:<exitcode>:<depth> <vars...> <funcs...> 2452 /* 1:hush 2:-$<pid>:<pid>:<exitcode>:<depth> <vars...> <funcs...>
2453 * 3:-c 4:<cmd> 5:<arg0> <argN...> 6:NULL 2453 * 3:-c 4:<cmd> 5:<arg0> <argN...> 6:NULL
@@ -3386,7 +3386,7 @@ static int run_pipe(struct pipe *pi)
3386 debug_printf_exec("run_pipe start: members:%d\n", pi->num_cmds); 3386 debug_printf_exec("run_pipe start: members:%d\n", pi->num_cmds);
3387 debug_enter(); 3387 debug_enter();
3388 3388
3389 USE_HUSH_JOB(pi->pgrp = -1;) 3389 IF_HUSH_JOB(pi->pgrp = -1;)
3390 pi->stopped_cmds = 0; 3390 pi->stopped_cmds = 0;
3391 command = &(pi->cmds[0]); 3391 command = &(pi->cmds[0]);
3392 argv_expanded = NULL; 3392 argv_expanded = NULL;
@@ -3821,7 +3821,7 @@ static int run_list(struct pipe *pi)
3821 rcode = G.last_exitcode; 3821 rcode = G.last_exitcode;
3822 3822
3823 /* Go through list of pipes, (maybe) executing them. */ 3823 /* Go through list of pipes, (maybe) executing them. */
3824 for (; pi; pi = USE_HUSH_LOOPS(rword == RES_DONE ? loop_top : ) pi->next) { 3824 for (; pi; pi = IF_HUSH_LOOPS(rword == RES_DONE ? loop_top : ) pi->next) {
3825 if (G.flag_SIGINT) 3825 if (G.flag_SIGINT)
3826 break; 3826 break;
3827 3827
@@ -4773,7 +4773,7 @@ static FILE *generate_stream_from_string(const char *s)
4773 close(channel[0]); /* NB: close _first_, then move fd! */ 4773 close(channel[0]); /* NB: close _first_, then move fd! */
4774 xmove_fd(channel[1], 1); 4774 xmove_fd(channel[1], 1);
4775 /* Prevent it from trying to handle ctrl-z etc */ 4775 /* Prevent it from trying to handle ctrl-z etc */
4776 USE_HUSH_JOB(G.run_list_level = 1;) 4776 IF_HUSH_JOB(G.run_list_level = 1;)
4777#if BB_MMU 4777#if BB_MMU
4778 reset_traps_to_defaults(); 4778 reset_traps_to_defaults();
4779 parse_and_run_string(s); 4779 parse_and_run_string(s);
@@ -5441,7 +5441,7 @@ static struct pipe *parse_stream(char **pstring,
5441 nommu_addchr(&ctx.as_string, ch); 5441 nommu_addchr(&ctx.as_string, ch);
5442 is_ifs = strchr(G.ifs, ch); 5442 is_ifs = strchr(G.ifs, ch);
5443 is_special = strchr("<>;&|(){}#'" /* special outside of "str" */ 5443 is_special = strchr("<>;&|(){}#'" /* special outside of "str" */
5444 "\\$\"" USE_HUSH_TICK("`") /* always special */ 5444 "\\$\"" IF_HUSH_TICK("`") /* always special */
5445 , ch); 5445 , ch);
5446 5446
5447 if (!is_special && !is_ifs) { /* ordinary char */ 5447 if (!is_special && !is_ifs) { /* ordinary char */
@@ -5832,7 +5832,7 @@ static struct pipe *parse_stream(char **pstring,
5832 } 5832 }
5833 /* Discard cached input, force prompt */ 5833 /* Discard cached input, force prompt */
5834 input->p = NULL; 5834 input->p = NULL;
5835 USE_HUSH_INTERACTIVE(input->promptme = 1;) 5835 IF_HUSH_INTERACTIVE(input->promptme = 1;)
5836 goto reset; 5836 goto reset;
5837 } 5837 }
5838} 5838}