--- sh.h.orig 2010-02-12 00:08:13.154592400 -0500 +++ sh.h 2010-02-12 00:36:27.472804000 -0500 @@ -339,6 +339,12 @@ # define ksh_strrchr_dirsep(p) strrchr(p, DIRSEP) #endif +#ifdef __CYGWIN__ +# define ARG0_HAS_DIRSEP(p) strpbrk(p, "/\\") +#else +# define ARG0_HAS_DIRSEP(p) ksh_strchr_dirsep(p) +#endif + typedef int bool_t; #define FALSE 0 #define TRUE 1 --- exec.c.orig 1999-07-13 12:53:46.000000000 -0400 +++ exec.c 2010-02-12 00:38:05.809630600 -0500 @@ -569,7 +569,7 @@ rv = subst_exstat; goto Leave; } else if (!tp) { - if (Flag(FRESTRICTED) && ksh_strchr_dirsep(cp)) { + if (Flag(FRESTRICTED) && ARG0_HAS_DIRSEP(cp)) { warningf(TRUE, "%s: restricted", cp); rv = 1; goto Leave; @@ -985,7 +985,7 @@ char *fpath; /* for function autoloading */ char *npath; - if (ksh_strchr_dirsep(name) != NULL) { + if (ARG0_HAS_DIRSEP(name) != NULL) { insert = 0; /* prevent FPATH search below */ flags &= ~FC_FUNC; @@ -1220,7 +1220,7 @@ if (search_access(Xstring(xs, xp), mode, errnop) == 0) return Xstring(xs, xp); /* not Xclose() - xp may be wrong */ #else /* OS2 */ - if (ksh_strchr_dirsep(name)) { + if (ARG0_HAS_DIRSEP(name)) { if (search_access(name, mode, errnop) == 0) return (char *) name; return NULL;