===================================================================
RCS file: f:\cvs\ash\Makefile,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 Makefile
===================================================================
RCS file: f:\cvs\ash\cd.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 cd.c
92c92
< 	if (*dest == '/' || (path = bltinlookup("CDPATH", 1)) == NULL)
---
> 	if (IS_ABSOLUTE(dest) || (path = bltinlookup("CDPATH", 1)) == NULL)
249c249
< 	while (*p != '/' && *p != '\0')
---
> 	while (!IS_SLASH(*p) && *p != '\0')
281c281
< 	if (*dir != '/') {
---
> 	if (!IS_ABSOLUTE(dir)) {
287c287
< 		if (p[-1] == '/')
---
> 		if (IS_SLASH(p[-1]))
292c292,293
< 			while (new > stackblock() && (STUNPUTC(new), *new) != '/');
---
> 			while (new > stackblock() &&
> 			       !IS_SLASH((STUNPUTC(new), *new)));
294c295
< 			STPUTC('/', new);
---
> 			STPUTC(SLASH, new);
300c301
< 		STPUTC('/', new);
---
> 		STPUTC(SLASH, new);
349a351,353
> #ifdef __EMX__
> 		execl("pwd", "pwd", (char *)0);
> #else
350a355
> #endif
===================================================================
RCS file: f:\cvs\ash\error.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 error.c
179a180
> #ifndef __EMX__
231c232
< 
---
> #endif
240a242,245
> #ifdef __EMX__
>         char *strerror(int);
>         return strerror(e);
> #else
249a255
> #endif
===================================================================
RCS file: f:\cvs\ash\exec.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 exec.c
113c113,133
< 
---
> /*
>  * Check whether the string is just a filename or it contains a path
>  */
> int
> has_dir_sep(path)
>         char *path;
>         {
> #if DOS_PATHS
> 	if (*path == ':')
>                 if (!path[1])
>                         return 0;
>         while (*path) {
>                 if ((*path == '/') || (*path == ':') || (*path == '\\'))
>                         return 1;
>                 path++;
>         }
> 	return 0;
> #else
>         return (strchr(path, '/') != NULL);
> #endif
> }
119c139,142
< 
---
> #ifdef __EMX__
> int
> _shellexec(argv, envp, path, index)
> #else
121a145
> #endif
128c152
< 	if (strchr(argv[0], '/') != NULL) {
---
> 	if (has_dir_sep(argv[0])) {
141a166,168
> #ifdef __EMX__
> 	return (e);
> #else
142a170
> #endif
144a173,199
> #ifdef __EMX__
> void
> shellexec(argv, envp, path, index)
> 	char **argv, **envp;
> 	char *path;
> 	{
>         int length = strlen(argv[0]);
> 
> 	if (length > 4) {
> 	    if (!stricmp(&argv[0][length-4], ".exe")) {
> 		length = 0;
> 	    }
> 	}
> 	if (length) {
> 	    char *oldarg = argv[0];
> 
> 	    argv[0] = ckmalloc(length+4);
> 	    strcpy(argv[0], oldarg);
> 	    strcat(argv[0], ".exe");
> 	    _shellexec(argv, envp, path, index);
> 	    free(argv[0]);
> 	    argv[0] = oldarg;
> 	}
> 	error2(argv[0], errmsg(_shellexec(argv, envp, path, index), E_EXEC));
> }
> #endif /* __EMX__ */
> 
154a210,226
> #ifdef __EMX__
>         if (access(cmd, R_OK))
>                 return;
> 	execve(cmd, argv, envp);
> 	initshellproc();
> 	setinputfile(cmd, 0);
> 	commandname = arg0 = savestr(argv[0]);
> 	pgetc(); pungetc();		/* fill up input buffer */
> 	p = parsenextc;
> 	if (parsenleft > 2 && p[0] == '#' && p[1] == '!') {
> 		argv[0] = cmd;
> 		execinterp(argv, envp);
> 	}
> 	setparam(argv + 1);
> 	exraise(EXSHELLPROC);
> #else
> 
179a252
> #endif
237c310
< 			while (*p != '/') {
---
> 			while (!IS_SLASH(*p)) {
286c359
< 	for (p = start ; *p && *p != ':' && *p != '%' ; p++);
---
> 	for (p = start ; *p && *p != PATH_SEP && *p != '%' ; p++);
294c367
< 		*q++ = '/';
---
> 		*q++ = SLASH;
300c373
< 		while (*p && *p != ':')  p++;
---
> 		while (*p && *p != PATH_SEP)  p++;
302c375
< 	if (*p == ':')
---
> 	if (*p == PATH_SEP)
394a468,470
> #ifdef __EMX__
> _find_command(name, entry, printerr)
> #else
395a472
> #endif
409c486
< 	if (strchr(name, '/') != NULL) {
---
> 	if (has_dir_sep(name)) {
462c539
< 		if (fullname[0] == '/' && index <= prev) {
---
> 		if (IS_ABSOLUTE(fullname) && index <= prev) {
467a545
> #ifndef __EMX__
479a558
> #endif /* !def __EMX__ */
487a567,572
> #ifdef __EMX__
>                 if (access(fullname, R_OK) == -1) {
>                         e = errno;
>                         goto loop;
>                 }
> #else
515a601
> #endif /* __EMX__ */
542a629,657
> #ifdef __EMX__
> void
> find_command(name, entry, printerr)
> 	char *name;
> 	struct cmdentry *entry;
> 	{
>         int length;
> 
>         _find_command(name, entry, 0);
> 	if (entry->cmdtype != CMDUNKNOWN)
> 	    return;
> 	if ((length = strlen(name)) > 4) {
> 	    if (!stricmp(&name[length-4], ".exe")) {
>                 if (printerr)
> 		    outfmt(out2, "%s: %s\n", name, errmsg(errno, E_EXEC));
> 		return;
> 	    }
> 	}
> 	if (length) {
> 	    char *buffer = ckmalloc(length+4);
> 
> 	    strcpy(buffer, name);
> 	    strcat(buffer, ".exe");
> 	    _find_command(buffer, entry, printerr);
> 	    free(buffer);
> 	}
> }
> #endif /* __EMX__ */
> 
607,608c722,723
< 			if (*old == '\0' && *new == ':'
< 			 || *old == ':' && *new == '\0')
---
> 			if (*old == '\0' && *new == PATH_SEP
> 			 || *old == PATH_SEP && *new == '\0')
616c731
< 		if (*new == ':') {
---
> 		if (*new == PATH_SEP) {
===================================================================
RCS file: f:\cvs\ash\exec.h,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 exec.h
58a59
> int has_dir_sep(char *);
67a69
> int has_dir_sep();
===================================================================
RCS file: f:\cvs\ash\expand.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 expand.c
655c655
< 		if (p[0] == '/' && p[1] == 'u' && p[2] == '/')
---
> 		if (IS_SLASH(p[0]) && p[1] == 'u' && IS_SLASH(p[2]))
716c716
< 	while (*p && *p != '/') {
---
> 	while (*p && !IS_SLASH(*p)) {
784c784
< 				if (*q == '/' || *q == '\0')
---
> 				if (IS_SLASH(*q) || *q == '\0')
797c797
< 		if (*p == '/') {
---
> 		if (IS_SLASH(*p)) {
828,829c828,829
< 	} else if (enddir == expdir + 1 && *expdir == '/') {
< 		p = "/";
---
> 	} else if (enddir == expdir + 1 && IS_SLASH(*expdir)) {
> 		p = SLASH;
837c837
< 		enddir[-1] = '/';
---
> 		enddir[-1] = SLASH;
857c857
< 				p[-1] = '/';
---
> 				p[-1] = SLASH;
864c864
< 		endname[-1] = '/';
---
> 		endname[-1] = SLASH;
===================================================================
RCS file: f:\cvs\ash\jobs.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 jobs.c
276a277
> #ifndef __EMX__
279a281
> #endif
746a749
> #ifndef __EMX__
749a753
> #endif
===================================================================
RCS file: f:\cvs\ash\mail.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 mail.c
92c92
< 		if (q[-1] != '/')
---
> 		if (!IS_SLASH(q[-1]))
===================================================================
RCS file: f:\cvs\ash\main.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 main.c
325a326
> #ifndef __EMX__
329a331
> #endif
===================================================================
RCS file: f:\cvs\ash\miscbltin.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 miscbltin.c
210a211
> #ifndef __EMX__
213a215
> #endif
216a219
> #ifndef __EMX__
218a222
> #endif
===================================================================
RCS file: f:\cvs\ash\mkbuiltins,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 mkbuiltins
===================================================================
RCS file: f:\cvs\ash\mkinit.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 mkinit.c
175a176,178
> #ifdef __EMX__
>                 rename(OUTTEMP, OUTFILE);
> #else
177a181
> #endif
183a188,190
> #ifdef __EMX__
> 	execl("cmd.exe", "cmd.exe", "/c", argv[1], (char *)0);
> #else
184a192
> #endif
===================================================================
RCS file: f:\cvs\ash\mktokens,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 mktokens
===================================================================
RCS file: f:\cvs\ash\mt,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 mt
===================================================================
RCS file: f:\cvs\ash\output.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 output.c
176a177,179
> #ifdef __EMX__
> int
> #else
177a181
> #endif
===================================================================
RCS file: f:\cvs\ash\output.h,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 output.h
67a68
> #ifndef __EMX__
68a70
> #endif
===================================================================
RCS file: f:\cvs\ash\redir.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 redir.c
224a225
> #ifndef __EMX__
231a233
> #endif
===================================================================
RCS file: f:\cvs\ash\shell.h,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 shell.h
41a42
>  *      DOS_PATHS -> 1 if you are working on a DOS filesystem
57a59,68
> #ifdef __EMX__
> #define DOS_PATHS 1
> #define JOBS 0
> #define SYMLINKS 0
> #define DIRENT 1
> #define UDIR 0
> #define ATTY 0
> #define SYSV
> #else
> #define DOS_PATHS 0
64a76
> #endif
88a101,112
> #endif
> 
> #if DOS_PATHS
> #define PATH_SEP ';'
> #define SLASH '\\'
> #define IS_SLASH(c) (((c) == '/') || ((c) == '\\'))
> #define IS_ABSOLUTE(p) (((*p) == '/') || ((*p) && ((p[1]) == ':')))
> #else
> #define PATH_SEP ':'
> #define SLASH '/'
> #define IS_SLASH(c) ((c) == '/')
> #define IS_ABSOLUTE(p) ((*p) == '/')
===================================================================
RCS file: f:\cvs\ash\trap.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 trap.c
145a146,148
> #ifdef __EMX__
>         void (*sigact)(int);
> #else
146a150
> #endif
cvs diff: Diffing bltin
===================================================================
RCS file: f:\cvs\ash\bltin\echo.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 echo.c
69c69
< 		} else if (equal(p, "-e")) {
---
> 		} else if (equal(p, "-e") || equal(p, "-E")) {
===================================================================
RCS file: f:\cvs\ash\bltin\test.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 test.c
286a287
> #ifdef S_IFBLK
287a289,291
> #else
>                 return 0;
> #endif
298a303
> #ifdef S_ISVTX
299a305,307
> #else
>                 return 0;
> #endif
cvs diff: Diffing funcs
