(svn r2321) - Fix: [ 1202286 ] On OS/2 you get a double backslash in your filename after browsing to the root dir of a drive and "." and ".." are incorrectly displayed. (orudge)
authormatthijs
Sun, 15 May 2005 14:01:35 +0000
changeset 1817 5a284107f72b
parent 1816 732d82acc97e
child 1818 56af6f0d6123
(svn r2321) - Fix: [ 1202286 ] On OS/2 you get a double backslash in your filename after browsing to the root dir of a drive and "." and ".." are incorrectly displayed. (orudge)
os2.c
--- a/os2.c	Sun May 15 13:48:23 2005 +0000
+++ b/os2.c	Sun May 15 14:01:35 2005 +0000
@@ -114,8 +114,8 @@
 		while ((dirent = readdir(dir)) != NULL) {
 			append_path(filename, _fios_path, dirent->d_name);
 			if (!stat(filename, &sb) && S_ISDIR(sb.st_mode) &&
-					strcmp(filename, ".") != 0 &&
-					strcmp(filename, "..") != 0) {
+					strcmp(dirent->d_name, ".") != 0 &&
+					strcmp(dirent->d_name, "..") != 0) {
 				fios = FiosAlloc();
 				fios->type = FIOS_TYPE_DIR;
 				fios->mtime = 0;
@@ -243,8 +243,8 @@
 		while ((dirent = readdir(dir)) != NULL) {
 			append_path(filename, _fios_path, dirent->d_name);
 			if (!stat(filename, &sb) && S_ISDIR(sb.st_mode) &&
-					strcmp(filename, ".") != 0 &&
-					strcmp(filename, "..") != 0) {
+					strcmp(dirent->d_name, ".") != 0 &&
+					strcmp(dirent->d_name, "..") != 0) {
 				fios = FiosAlloc();
 				fios->type = FIOS_TYPE_DIR;
 				fios->mtime = 0;
@@ -357,7 +357,7 @@
 		case FIOS_TYPE_DIR:
 			s = strchr(item->name, '\\');
 			if (s != NULL) *s = '\0';
-			strcat(path, "\\");
+			if (path[3]!= '\0' ) strcat(path, "\\");
 			strcat(path, item->name);
 			break;