diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-07-26 00:53:56 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-07-26 00:53:56 +0000 |
commit | e92108ae6d9edab40b3c5c921ebfd0fea3c16614 (patch) | |
tree | 1eac5f9f6c7aab32c9928599692a08f608bbe472 | |
parent | 0d49dd53cf938c3130ac2d9eed4d3380ba9d952a (diff) | |
download | busybox-w32-e92108ae6d9edab40b3c5c921ebfd0fea3c16614.tar.gz busybox-w32-e92108ae6d9edab40b3c5c921ebfd0fea3c16614.tar.bz2 busybox-w32-e92108ae6d9edab40b3c5c921ebfd0fea3c16614.zip |
Minor style cleanups.
-rw-r--r-- | lash.c | 17 | ||||
-rw-r--r-- | sh.c | 17 | ||||
-rw-r--r-- | shell/lash.c | 17 |
3 files changed, 27 insertions, 24 deletions
@@ -56,10 +56,11 @@ enum redirectionType { REDIRECT_INPUT, REDIRECT_OVERWRITE, | |||
56 | REDIRECT_APPEND | 56 | REDIRECT_APPEND |
57 | }; | 57 | }; |
58 | 58 | ||
59 | #define REGULAR_JOB_CONTEXT 0x1 | 59 | static const unsigned int REGULAR_JOB_CONTEXT=0x1; |
60 | #define IF_EXP_CONTEXT 0x2 | 60 | static const unsigned int IF_EXP_CONTEXT=0x2; |
61 | #define THEN_EXP_CONTEXT 0x4 | 61 | static const unsigned int THEN_EXP_CONTEXT=0x4; |
62 | #define ELSE_EXP_CONTEXT 0x8 | 62 | static const unsigned int ELSE_EXP_CONTEXT=0x8; |
63 | |||
63 | 64 | ||
64 | enum jobContext { REGULAR_APP, IF_CONTEXT, THEN_CONTEXT | 65 | enum jobContext { REGULAR_APP, IF_CONTEXT, THEN_CONTEXT |
65 | }; | 66 | }; |
@@ -589,8 +590,8 @@ static void globLastArgument(struct childProgram *prog, int *argcPtr, | |||
589 | return; | 590 | return; |
590 | } else if (rc == GLOB_NOMATCH || | 591 | } else if (rc == GLOB_NOMATCH || |
591 | (!rc && (prog->globResult.gl_pathc - i) == 1 && | 592 | (!rc && (prog->globResult.gl_pathc - i) == 1 && |
592 | !strcmp(prog->argv[argc - 1], | 593 | strcmp(prog->argv[argc - 1], |
593 | prog->globResult.gl_pathv[i]))) { | 594 | prog->globResult.gl_pathv[i]) == 0)) { |
594 | /* we need to remove whatever \ quoting is still present */ | 595 | /* we need to remove whatever \ quoting is still present */ |
595 | src = dst = prog->argv[argc - 1]; | 596 | src = dst = prog->argv[argc - 1]; |
596 | while (*src) { | 597 | while (*src) { |
@@ -953,7 +954,7 @@ static int runCommand(struct job *newJob, struct jobSet *jobList, int inBg, int | |||
953 | 954 | ||
954 | /* Check if the command matches any non-forking builtins */ | 955 | /* Check if the command matches any non-forking builtins */ |
955 | for (x = bltins; x->cmd; x++) { | 956 | for (x = bltins; x->cmd; x++) { |
956 | if (!strcmp(newJob->progs[i].argv[0], x->cmd)) { | 957 | if (strcmp(newJob->progs[i].argv[0], x->cmd) == 0 ) { |
957 | return (x->function(newJob, jobList)); | 958 | return (x->function(newJob, jobList)); |
958 | } | 959 | } |
959 | } | 960 | } |
@@ -980,7 +981,7 @@ static int runCommand(struct job *newJob, struct jobSet *jobList, int inBg, int | |||
980 | 981 | ||
981 | /* Check if the command matches any of the other builtins */ | 982 | /* Check if the command matches any of the other builtins */ |
982 | for (x = bltins_forking; x->cmd; x++) { | 983 | for (x = bltins_forking; x->cmd; x++) { |
983 | if (!strcmp(newJob->progs[i].argv[0], x->cmd)) { | 984 | if (strcmp(newJob->progs[i].argv[0], x->cmd) == 0) { |
984 | exit (x->function(newJob, jobList)); | 985 | exit (x->function(newJob, jobList)); |
985 | } | 986 | } |
986 | } | 987 | } |
@@ -56,10 +56,11 @@ enum redirectionType { REDIRECT_INPUT, REDIRECT_OVERWRITE, | |||
56 | REDIRECT_APPEND | 56 | REDIRECT_APPEND |
57 | }; | 57 | }; |
58 | 58 | ||
59 | #define REGULAR_JOB_CONTEXT 0x1 | 59 | static const unsigned int REGULAR_JOB_CONTEXT=0x1; |
60 | #define IF_EXP_CONTEXT 0x2 | 60 | static const unsigned int IF_EXP_CONTEXT=0x2; |
61 | #define THEN_EXP_CONTEXT 0x4 | 61 | static const unsigned int THEN_EXP_CONTEXT=0x4; |
62 | #define ELSE_EXP_CONTEXT 0x8 | 62 | static const unsigned int ELSE_EXP_CONTEXT=0x8; |
63 | |||
63 | 64 | ||
64 | enum jobContext { REGULAR_APP, IF_CONTEXT, THEN_CONTEXT | 65 | enum jobContext { REGULAR_APP, IF_CONTEXT, THEN_CONTEXT |
65 | }; | 66 | }; |
@@ -589,8 +590,8 @@ static void globLastArgument(struct childProgram *prog, int *argcPtr, | |||
589 | return; | 590 | return; |
590 | } else if (rc == GLOB_NOMATCH || | 591 | } else if (rc == GLOB_NOMATCH || |
591 | (!rc && (prog->globResult.gl_pathc - i) == 1 && | 592 | (!rc && (prog->globResult.gl_pathc - i) == 1 && |
592 | !strcmp(prog->argv[argc - 1], | 593 | strcmp(prog->argv[argc - 1], |
593 | prog->globResult.gl_pathv[i]))) { | 594 | prog->globResult.gl_pathv[i]) == 0)) { |
594 | /* we need to remove whatever \ quoting is still present */ | 595 | /* we need to remove whatever \ quoting is still present */ |
595 | src = dst = prog->argv[argc - 1]; | 596 | src = dst = prog->argv[argc - 1]; |
596 | while (*src) { | 597 | while (*src) { |
@@ -953,7 +954,7 @@ static int runCommand(struct job *newJob, struct jobSet *jobList, int inBg, int | |||
953 | 954 | ||
954 | /* Check if the command matches any non-forking builtins */ | 955 | /* Check if the command matches any non-forking builtins */ |
955 | for (x = bltins; x->cmd; x++) { | 956 | for (x = bltins; x->cmd; x++) { |
956 | if (!strcmp(newJob->progs[i].argv[0], x->cmd)) { | 957 | if (strcmp(newJob->progs[i].argv[0], x->cmd) == 0 ) { |
957 | return (x->function(newJob, jobList)); | 958 | return (x->function(newJob, jobList)); |
958 | } | 959 | } |
959 | } | 960 | } |
@@ -980,7 +981,7 @@ static int runCommand(struct job *newJob, struct jobSet *jobList, int inBg, int | |||
980 | 981 | ||
981 | /* Check if the command matches any of the other builtins */ | 982 | /* Check if the command matches any of the other builtins */ |
982 | for (x = bltins_forking; x->cmd; x++) { | 983 | for (x = bltins_forking; x->cmd; x++) { |
983 | if (!strcmp(newJob->progs[i].argv[0], x->cmd)) { | 984 | if (strcmp(newJob->progs[i].argv[0], x->cmd) == 0) { |
984 | exit (x->function(newJob, jobList)); | 985 | exit (x->function(newJob, jobList)); |
985 | } | 986 | } |
986 | } | 987 | } |
diff --git a/shell/lash.c b/shell/lash.c index b2d1d43d3..f746757d8 100644 --- a/shell/lash.c +++ b/shell/lash.c | |||
@@ -56,10 +56,11 @@ enum redirectionType { REDIRECT_INPUT, REDIRECT_OVERWRITE, | |||
56 | REDIRECT_APPEND | 56 | REDIRECT_APPEND |
57 | }; | 57 | }; |
58 | 58 | ||
59 | #define REGULAR_JOB_CONTEXT 0x1 | 59 | static const unsigned int REGULAR_JOB_CONTEXT=0x1; |
60 | #define IF_EXP_CONTEXT 0x2 | 60 | static const unsigned int IF_EXP_CONTEXT=0x2; |
61 | #define THEN_EXP_CONTEXT 0x4 | 61 | static const unsigned int THEN_EXP_CONTEXT=0x4; |
62 | #define ELSE_EXP_CONTEXT 0x8 | 62 | static const unsigned int ELSE_EXP_CONTEXT=0x8; |
63 | |||
63 | 64 | ||
64 | enum jobContext { REGULAR_APP, IF_CONTEXT, THEN_CONTEXT | 65 | enum jobContext { REGULAR_APP, IF_CONTEXT, THEN_CONTEXT |
65 | }; | 66 | }; |
@@ -589,8 +590,8 @@ static void globLastArgument(struct childProgram *prog, int *argcPtr, | |||
589 | return; | 590 | return; |
590 | } else if (rc == GLOB_NOMATCH || | 591 | } else if (rc == GLOB_NOMATCH || |
591 | (!rc && (prog->globResult.gl_pathc - i) == 1 && | 592 | (!rc && (prog->globResult.gl_pathc - i) == 1 && |
592 | !strcmp(prog->argv[argc - 1], | 593 | strcmp(prog->argv[argc - 1], |
593 | prog->globResult.gl_pathv[i]))) { | 594 | prog->globResult.gl_pathv[i]) == 0)) { |
594 | /* we need to remove whatever \ quoting is still present */ | 595 | /* we need to remove whatever \ quoting is still present */ |
595 | src = dst = prog->argv[argc - 1]; | 596 | src = dst = prog->argv[argc - 1]; |
596 | while (*src) { | 597 | while (*src) { |
@@ -953,7 +954,7 @@ static int runCommand(struct job *newJob, struct jobSet *jobList, int inBg, int | |||
953 | 954 | ||
954 | /* Check if the command matches any non-forking builtins */ | 955 | /* Check if the command matches any non-forking builtins */ |
955 | for (x = bltins; x->cmd; x++) { | 956 | for (x = bltins; x->cmd; x++) { |
956 | if (!strcmp(newJob->progs[i].argv[0], x->cmd)) { | 957 | if (strcmp(newJob->progs[i].argv[0], x->cmd) == 0 ) { |
957 | return (x->function(newJob, jobList)); | 958 | return (x->function(newJob, jobList)); |
958 | } | 959 | } |
959 | } | 960 | } |
@@ -980,7 +981,7 @@ static int runCommand(struct job *newJob, struct jobSet *jobList, int inBg, int | |||
980 | 981 | ||
981 | /* Check if the command matches any of the other builtins */ | 982 | /* Check if the command matches any of the other builtins */ |
982 | for (x = bltins_forking; x->cmd; x++) { | 983 | for (x = bltins_forking; x->cmd; x++) { |
983 | if (!strcmp(newJob->progs[i].argv[0], x->cmd)) { | 984 | if (strcmp(newJob->progs[i].argv[0], x->cmd) == 0) { |
984 | exit (x->function(newJob, jobList)); | 985 | exit (x->function(newJob, jobList)); |
985 | } | 986 | } |
986 | } | 987 | } |