From 52e9469a82077f72eee9bd2b76f9d0b8634976ba Mon Sep 17 00:00:00 2001 From: tg Date: Sat, 27 Mar 2010 15:29:00 +0000 Subject: [PATCH] make MKSH_DEFAULT_EXECSHELL (/bin/sh) configurable, for Android --- Build.sh | 4 ++-- exec.c | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Build.sh b/Build.sh index 3771509..880325f 100644 --- a/Build.sh +++ b/Build.sh @@ -1,5 +1,5 @@ #!/bin/sh -srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.446 2010/03/14 11:58:29 tg Exp $' +srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.447 2010/03/27 15:28:59 tg Exp $' #- # Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Thorsten Glaser @@ -28,7 +28,7 @@ srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.446 2010/03/14 11:58:29 tg Exp $' # CPPFLAGS recognised: MKSH_ASSUME_UTF8 MKSH_BINSHREDUCED MKSH_CLS_STRING # MKSH_CONSERVATIVE_FDS MKSH_MIDNIGHTBSD01ASH_COMPAT # MKSH_NOPWNAM MKSH_NO_LIMITS MKSH_SMALL MKSH_S_NOVI -# MKSH_UNEMPLOYED +# MKSH_UNEMPLOYED MKSH_DEFAULT_EXECSHELL LC_ALL=C export LC_ALL diff --git a/exec.c b/exec.c index e80ef1d..65d7779 100644 --- a/exec.c +++ b/exec.c @@ -1,7 +1,7 @@ /* $OpenBSD: exec.c,v 1.49 2009/01/29 23:27:26 jaredy Exp $ */ /*- - * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009 + * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 * Thorsten Glaser * * Provided that these terms and disclaimer and all copyright notices @@ -22,7 +22,11 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.72 2009/12/12 22:27:06 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.73 2010/03/27 15:29:00 tg Exp $"); + +#ifndef MKSH_DEFAULT_EXECSHELL +#define MKSH_DEFAULT_EXECSHELL "/bin/sh" +#endif static int comexec(struct op *, struct tbl *volatile, const char **, int volatile, volatile int *); @@ -711,7 +715,7 @@ scriptexec(struct op *tp, const char **ap) if (sh && *sh) sh = search(sh, path, X_OK, NULL); if (!sh || !*sh) - sh = "/bin/sh"; + sh = MKSH_DEFAULT_EXECSHELL; *tp->args-- = tp->str;