more mksh-os2 inspired hackery

This commit is contained in:
tg 2015-07-09 19:59:14 +00:00
parent 483536e336
commit d034be7a84
2 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.685 2015/07/09 19:46:40 tg Exp $'
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.686 2015/07/09 19:59:13 tg Exp $'
#-
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012, 2013, 2014, 2015
@ -1060,7 +1060,7 @@ ct="unknown"
#endif
;
const char *
#if defined(__KLIBC__)
#if defined(__KLIBC__) && !defined(__OS2__)
et="klibc"
#else
et="unknown"

7
exec.c
View File

@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.156 2015/07/09 19:46:41 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.157 2015/07/09 19:59:14 tg Exp $");
#ifndef MKSH_DEFAULT_EXECSHELL
#define MKSH_DEFAULT_EXECSHELL "/bin/sh"
@ -973,7 +973,10 @@ scriptexec(struct op *tp, const char **ap)
(m == /* ECOFF_I386 */ 0x4C01) ||
(m == /* ECOFF_M68K */ 0x0150 || m == 0x5001) ||
(m == /* ECOFF_SH */ 0x0500 || m == 0x0005) ||
(m == /* "MZ" */ 0x4D5A) ||
(m == /* bzip */ 0x425A) || (m == /* "MZ" */ 0x4D5A) ||
(m == /* "NE" */ 0x4E45) || (m == /* "LX" */ 0x4C58) ||
(m == /* xz */ 0xFD37 && buf[2] == 'z' && buf[3] == 'X' &&
buf[4] == 'Z') || (m == /* 7zip */ 0x377A) ||
(m == /* gzip */ 0x1F8B) || (m == /* .Z */ 0x1F9D))
errorf("%s: not executable: magic %04X", tp->str, m);
nomagic: