fixup “\builtin” on OS/2; thanks komh for spotting this

This commit is contained in:
tg 2017-03-22 00:20:53 +00:00
parent e991806f2b
commit 034d0c0269
2 changed files with 10 additions and 4 deletions

8
exec.c
View File

@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.190 2017/03/12 02:04:12 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.191 2017/03/22 00:20:51 tg Exp $");
#ifndef MKSH_DEFAULT_EXECSHELL
#define MKSH_DEFAULT_EXECSHELL MKSH_UNIXROOT "/bin/sh"
@ -1135,7 +1135,11 @@ findcom(const char *name, int flags)
char *fpath;
union mksh_cchack npath;
if (mksh_vdirsep(name)) {
if (mksh_vdirsep(name)
#ifdef __OS2__
&& (strcmp(name, T_builtin) != 0)
#endif
) {
insert = 0;
/* prevent FPATH search below */
flags &= ~FC_FUNC;

6
sh.h
View File

@ -175,9 +175,9 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.796 2017/03/19 22:31:29 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.797 2017/03/22 00:20:53 tg Exp $");
#endif
#define MKSH_VERSION "R54 2017/03/19"
#define MKSH_VERSION "R54 2017/03/21"
/* arithmetic types: C implementation */
#if !HAVE_CAN_INTTYPES
@ -865,6 +865,7 @@ EXTERN const char Tbad_bsize[] E_INIT("bad shf/buf/bsize");
EXTERN const char Tbad_sig_ss[] E_INIT("%s: bad signal '%s'");
#define Tbad_sig_s (Tbad_sig_ss + 4)
EXTERN const char T__builtin[] E_INIT("-\\builtin");
#define T_builtin (T__builtin + 1)
#define Tbuiltin (T__builtin + 2)
EXTERN const char Toomem[] E_INIT("can't allocate %zu data bytes");
EXTERN const char Tcant_cd[] E_INIT("restricted shell - can't cd");
@ -1012,6 +1013,7 @@ EXTERN const char T_devtty[] E_INIT("/dev/tty");
#define Tbad_sig_ss "%s: bad signal '%s'"
#define Tbad_sig_s "bad signal '%s'"
#define T__builtin "-\\builtin"
#define T_builtin "\\builtin"
#define Tbuiltin "builtin"
#define Toomem "can't allocate %zu data bytes"
#define Tcant_cd "restricted shell - can't cd"