• Build.sh: fix NSIG detection for gcc-snapshot

• all: bump version to R50-current; add more comments; whitespace
• all: remove all mkssert(); we’ll do full re-runs of scan-build and,
  hopefully, Coverity Scan/Prevent
• check.t: fix a testcase (sed could exit false, but we don’t care)
• eval.c: fix tilde_ok data type (only unsigned may shl constantly)
• exec.c: fix shebang buf array accesses to always go via uint8_t *
This commit is contained in:
tg
2014-11-25 21:13:31 +00:00
parent 371ee4af07
commit 2f52b993a1
13 changed files with 57 additions and 61 deletions

13
exec.c
View File

@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.137 2014/10/19 21:53:07 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.138 2014/11/25 21:13:24 tg Exp $");
#ifndef MKSH_DEFAULT_EXECSHELL
#define MKSH_DEFAULT_EXECSHELL "/bin/sh"
@ -924,11 +924,12 @@ scriptexec(struct op *tp, const char **ap)
*tp->args-- = (char *)cp;
}
noshebang:
if (buf[0] == 0x7F && buf[1] == 'E' && buf[2] == 'L' &&
buf[3] == 'F')
cp = (unsigned char *)buf;
if (cp[0] == 0x7F && cp[1] == 'E' && cp[2] == 'L' &&
cp[3] == 'F')
errorf("%s: not executable: %d-bit ELF file", tp->str,
32 * ((uint8_t)buf[4]));
fd = buf[0] << 8 | buf[1];
32 * cp[4]);
fd = cp[0] << 8 | cp[1];
if ((fd == /* OMAGIC */ 0407) ||
(fd == /* NMAGIC */ 0410) ||
(fd == /* ZMAGIC */ 0413) ||
@ -1006,8 +1007,6 @@ define(const char *name, struct op *t)
while (/* CONSTCOND */ 1) {
tp = findfunc(name, nhash, true);
/* because findfunc:create=true */
mkssert(tp != NULL);
if (tp->flag & ISSET)
was_set = true;