[Scummvm-cvs-logs] SF.net SVN: scummvm:[34595] scummvm/trunk/backends/fs/posix/posix-fs.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Sep 17 20:26:45 CEST 2008


Revision: 34595
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34595&view=rev
Author:   fingolfin
Date:     2008-09-17 18:26:44 +0000 (Wed, 17 Sep 2008)

Log Message:
-----------
Patch #2043093 (again - new patch): OS/2 patches for posix-fs

Modified Paths:
--------------
    scummvm/trunk/backends/fs/posix/posix-fs.cpp

Modified: scummvm/trunk/backends/fs/posix/posix-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/posix/posix-fs.cpp	2008-09-17 18:25:51 UTC (rev 34594)
+++ scummvm/trunk/backends/fs/posix/posix-fs.cpp	2008-09-17 18:26:44 UTC (rev 34595)
@@ -62,6 +62,11 @@
 		_path = p;
 	}
 	
+#ifdef __OS2__
+	// On OS/2, 'X:/' is a root of drive X, so we should not remove that last
+	// slash.
+	if (!(_path.size() == 3 && _path.hasSuffix(":/")))
+#endif
 	// Normalize the path (that is, remove unneeded slashes etc.)
 	_path = Common::normalizePath(_path, '/');
 	_displayName = Common::lastPathComponent(_path, '/');
@@ -97,7 +102,7 @@
 	// We assume here that _path is already normalized (hence don't bother to call
 	//  Common::normalizePath on the final path).
 	Common::String newPath(_path);
-	if (_path != "/")
+	if (_path.lastChar() != '/')
 		newPath += '/';
 	newPath += n;
 
@@ -117,14 +122,14 @@
 	
 		for (int i = 0; i < 26; i++) {
 			if (ulDrvMap & 1) {
-				char *drive_root = "A:";
+				char drive_root[] = "A:/";
 				drive_root[0] += i;
 	
                 POSIXFilesystemNode *entry = new POSIXFilesystemNode();
 				entry->_isDirectory = true;
 				entry->_isValid = true;
 				entry->_path = drive_root;
-				entry->_displayName = "[" + entry->_path + "]";
+				entry->_displayName = "[" + Common::String(drive_root, 2) + "]";
 				myList.push_back(entry);
 			}
 	


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list