diff --git a/NEWS b/NEWS index 4b34437ae..888814b9f 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,12 @@ For full details, see the git log at: https://github.com/ksh93/ksh Any uppercase BUG_* names are modernish shell bug IDs. +2020-08-16: + +- Fixed 'command -x' on macOS, Linux and Solaris by accounting for a 16-byte + argument alignment. If execution does fail, it now aborts with an internal + error message instead of entering an infinite retry loop. + 2020-08-13: - Fixed memory leaks and a crashing bug that occurred when defining and diff --git a/src/cmd/ksh93/sh/path.c b/src/cmd/ksh93/sh/path.c index 5447b0275..9b683539f 100644 --- a/src/cmd/ksh93/sh/path.c +++ b/src/cmd/ksh93/sh/path.c @@ -175,8 +175,12 @@ static pid_t path_xargs(Shell_t *shp,const char *path, char *argv[],char *const shp->exitval = 0; while(av0 && av0) return(pid); -retry: switch(shp->path_err = errno) { case ENOEXEC: @@ -1238,7 +1241,7 @@ retry: { pid = path_xargs(shp,opath, &argv[0] ,envp,spawn); if(pid<0) - goto retry; + errormsg(SH_DICT,ERROR_system(ERROR_NOEXEC),"%s: 'command -x' failed",path); return(pid); } default: