diff --git a/clite/core.js b/clite/core.js index 57e920a..dc126f3 100644 --- a/clite/core.js +++ b/clite/core.js @@ -2253,7 +2253,12 @@ clite.lib = { if (!fd.canexec) { clite.io.close(io.pid,fd); - return -3 + return -3; + } + + if (clite.lib.getFileType(fd) != clite.io.types.FT_BINARY) { + clite.io.close(io.pid,fd); + return -4; } clite.proc.update(args.join(' ')); diff --git a/clite/shell.js b/clite/shell.js index d8322e3..5a8021c 100644 --- a/clite/shell.js +++ b/clite/shell.js @@ -312,7 +312,7 @@ clite.commands.load('sh',function(args,env,io) { io.exit(-1); } - if (r == -3) { + if (r == -3 || r == -4) { stdio.write(io.stderr,'Shell: not an executable file:'+args[0]); io.exit(-3); }