(svn r3097) - Fix (regression): unix has a trailing slash after the paths, windows does not, no idea why os2 has. Way to go consistency :s. So anyways, just strip trailing slash
authorDarkvater
Fri, 28 Oct 2005 00:18:57 +0000
changeset 2560 00ad0c27c2f3
parent 2559 08e648022cb0
child 2561 c78c3d248897
(svn r3097) - Fix (regression): unix has a trailing slash after the paths, windows does not, no idea why os2 has. Way to go consistency :s. So anyways, just strip trailing slash
os2.c
unix.c
win32.c
--- a/os2.c	Fri Oct 28 00:09:59 2005 +0000
+++ b/os2.c	Fri Oct 28 00:18:57 2005 +0000
@@ -356,6 +356,8 @@
 
 		case FIOS_TYPE_DIRECT:
 			sprintf(path, "%s\\", item->name);
+			s = strrchr(path, '\\');
+			if (s[1] == '\0') s[0] = '\0'; // strip trailing slash
 			break;
 
 		case FIOS_TYPE_FILE:
--- a/unix.c	Fri Oct 28 00:09:59 2005 +0000
+++ b/unix.c	Fri Oct 28 00:18:57 2005 +0000
@@ -312,7 +312,9 @@
 			break;
 
 		case FIOS_TYPE_DIRECT:
-			sprintf(path, "%s\\", item->name);
+			sprintf(path, "%s/", item->name);
+			s = strrchr(path, '/');
+			if (s[1] == '\0') s[0] = '\0'; // strip trailing slash
 			break;
 
 		case FIOS_TYPE_FILE:
--- a/win32.c	Fri Oct 28 00:09:59 2005 +0000
+++ b/win32.c	Fri Oct 28 00:18:57 2005 +0000
@@ -919,6 +919,9 @@
 
 		case FIOS_TYPE_DIRECT:
 			sprintf(path, "%s\\", item->name);
+			s = strrchr(path, '\\');
+			if (s[1] == '\0') s[0] = '\0'; // strip trailing slash
+
 			break;
 
 		case FIOS_TYPE_FILE: