aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2009-04-23 17:20:31 +1000
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2009-04-23 17:20:31 +1000
commit6f2abbc7688fc00d11fa449df83fc1e2303e06e5 (patch)
tree882202fd8d5660b5a184b04fbcd1edc7061e129a
parent7aa601da1e0bdc6edf0e4c37ff77bec92c0aff3b (diff)
downloadbusybox-w32-6f2abbc7688fc00d11fa449df83fc1e2303e06e5.tar.gz
busybox-w32-6f2abbc7688fc00d11fa449df83fc1e2303e06e5.tar.bz2
busybox-w32-6f2abbc7688fc00d11fa449df83fc1e2303e06e5.zip
shell/ash: redo execcmd() and get rid of shellexec()
-rw-r--r--shell/ash.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 083903486..36abc7059 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -6621,6 +6621,7 @@ struct tblentry {
6621static struct tblentry *cmdtable[CMDTABLESIZE]; 6621static struct tblentry *cmdtable[CMDTABLESIZE];
6622static int builtinloc = -1; /* index in path of %builtin, or -1 */ 6622static int builtinloc = -1; /* index in path of %builtin, or -1 */
6623 6623
6624#ifndef __MINGW32__
6624static void 6625static void
6625tryexec(char *cmd, char **argv, char **envp) 6626tryexec(char *cmd, char **argv, char **envp)
6626{ 6627{
@@ -6725,6 +6726,7 @@ shellexec(char **argv, const char *path, int idx)
6725 ash_msg_and_raise(EXEXEC, "%s: %s", argv[0], errmsg(e, "not found")); 6726 ash_msg_and_raise(EXEXEC, "%s: %s", argv[0], errmsg(e, "not found"));
6726 /* NOTREACHED */ 6727 /* NOTREACHED */
6727} 6728}
6729#endif
6728 6730
6729static void 6731static void
6730printentry(struct tblentry *cmdp) 6732printentry(struct tblentry *cmdp)
@@ -8144,10 +8146,19 @@ static int
8144execcmd(int argc, char **argv) 8146execcmd(int argc, char **argv)
8145{ 8147{
8146 if (argc > 1) { 8148 if (argc > 1) {
8149#ifdef __MINGW32__
8150 int ret;
8151#endif
8147 iflag = 0; /* exit on error */ 8152 iflag = 0; /* exit on error */
8148 mflag = 0; 8153 mflag = 0;
8149 optschanged(); 8154 optschanged();
8155#ifdef __MINGW32__
8156 ret = shellspawn(argv + 1, pathval(), 0, NULL);
8157 if (ret != -1)
8158 exit(exitstatus);
8159#else
8150 shellexec(argv + 1, pathval(), 0); 8160 shellexec(argv + 1, pathval(), 0);
8161#endif
8151 } 8162 }
8152 return 0; 8163 return 0;
8153} 8164}