exec: remove the last / or \ when searching $PATH

For example, X:/ becomes to X://name. CMD.EXE is not tolerant of such
a style.

    modified:   exec.c
This commit is contained in:
KO Myung-Hun 2016-12-23 15:41:30 +09:00
parent bf88879b0d
commit f814ccfb8f
1 changed files with 4 additions and 0 deletions

4
exec.c
View File

@ -1327,6 +1327,10 @@ search_path(const char *name, const char *lpath,
XcheckN(xs, xp, p - sp);
memcpy(xp, sp, p - sp);
xp += p - sp;
#ifdef __OS2__
if (xp > Xstring(xs, xp) && mksh_cdirsep(xp[-1]))
xp--;
#endif
*xp++ = '/';
}
sp = p;