[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trailing slashes problem



I could use some help...

Below are Andreas Schwab's trailing slashes patches.  It took me a few
hours to track down that it was them which caused my machine to crash
when launching the ROM GEM.

>From the debug output it looks like the crash occurs inside AMC-GDOS
while looking for assign.sys (or something like that) when AES opens
its graphics workstation.  The last thing before the bus error was a
relpathtocookie("\\") (<- this means two backslashes) or
relpathtocookie("") -- I don't remember exactly.  I can't try without
AMC-GDOS as I need it to drive my graphics card.

As these patches are intended to make MiNT more TOS compatible, and
because I can boot into GEM fine under TOS, I guess there must be
something wrong with them, though I can't see what.

Any ideas?

Michael
-- 
Email: hohmuth@inf.tu-dresden.de
WWW:   http://www.inf.tu-dresden.de/~mh1/

------------------------------------------------------------------------------

diff -u mint/filesys.c:1.14 mint/filesys.c:1.15
--- mint/filesys.c:1.14	Sun Mar 19 01:40:32 1995
+++ mint/filesys.c	Sun Mar 19 01:40:32 1995
@@ -873,6 +873,11 @@
 
 	while (*path) {
 
+	/* 
+	 * skip slashes
+	 */
+		while (DIRSEP(*path)) path++;
+
 	/* now we must have a directory, since there are more things in the path */
 		if ((xattr.mode & S_IFMT) != S_IFDIR) {
 PATH2COOKIE_DB(("relpath2cookie: not a directory, returning EPTHNF"));
@@ -914,11 +919,6 @@
 			break;
 		}
 
-
-	/* 
-	 * skip trailing slashes
-	 */
-		while (DIRSEP(*path)) path++;
 
 PATH2COOKIE_DB(("relpath2cookie: looking up [%s]", lastname));
 
diff -u mint/tosfs.c:1.12 mint/tosfs.c:1.13
--- mint/tosfs.c:1.12	Sun Mar 19 01:40:33 1995
+++ mint/tosfs.c	Sun Mar 19 01:40:33 1995
@@ -480,6 +480,7 @@
 
 	while(*path) {
 /* get next name in path */
+		while (DIRSEP(*path)) path++;
 		n = name; namelen = 0;
 		while (*path && !DIRSEP(*path)) {
 /* BUG: we really should to the translation to DOS 8.3
@@ -493,7 +494,6 @@
 				path++;
 		}
 		*n = 0;
-		while (DIRSEP(*path)) path++;
 /* check for "." and ".." */
 		if (!strcmp(name, ".")) continue;
 		if (!strcmp(name, "..")) {