Path separator is ; on OS/2

This commit is contained in:
KO Myung-Hun
2015-05-07 12:51:22 +09:00
parent c29f892437
commit 8f633da789
5 changed files with 12 additions and 4 deletions

2
edit.c
View File

@ -771,7 +771,7 @@ glob_path(int flags, const char *pat, XPtrV *wp, const char *lpath)
Xinit(xs, xp, patlen + 128, ATEMP);
while (sp) {
xp = Xstring(xs, xp);
if (!(p = cstrchr(sp, ':')))
if (!(p = cstrchr(sp, PATH_SEP)))
p = sp + strlen(sp);
pathlen = p - sp;
if (pathlen) {

2
exec.c
View File

@ -1271,7 +1271,7 @@ search_path(const char *name, const char *lpath,
sp = lpath;
while (sp != NULL) {
xp = Xstring(xs, xp);
if (!(p = cstrchr(sp, ':')))
if (!(p = cstrchr(sp, PATH_SEP)))
p = sp + strlen(sp);
if (p != sp) {
XcheckN(xs, xp, p - sp);

2
main.c
View File

@ -82,7 +82,7 @@ static const char *initcoms[] = {
"nameref=\\typeset -n",
"nohup=nohup ",
"r=\\builtin fc -e -",
"source=PATH=$PATH:. \\command .",
"source=PATH=\"$PATH" PATH_SEP_STR ".\" \\command .",
"login=\\exec login",
NULL,
/* this is what AT&T ksh seems to track, with the addition of emacs */

2
misc.c
View File

@ -1636,7 +1636,7 @@ make_path(const char *cwd, const char *file,
else if (use_cdpath) {
char *pend;
for (pend = plist; *pend && *pend != ':'; pend++)
for (pend = plist; *pend && *pend != PATH_SEP; pend++)
;
plen = pend - plist;
*cdpathp = *pend ? pend + 1 : NULL;

8
sh.h
View File

@ -299,6 +299,14 @@ struct rusage {
} while (/* CONSTCOND */ 0)
#endif
#ifdef __OS2__
#define PATH_SEP ';'
#define PATH_SEP_STR ";"
#else
#define PATH_SEP ':'
#define PATH_SEP_STR ":"
#endif
#ifdef MKSH__NO_PATH_MAX
#undef PATH_MAX
#else