]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/missing.cpp
ixing a big problem on Windows platforms that has to do with copying over
[xonotic/netradiant.git] / radiant / missing.cpp
index e610fbb02b4ec6a216edd18fde5d91f87a4ab5e4..246946830125efd01f88b14dc1ae80f9bda25f8e 100644 (file)
@@ -168,7 +168,17 @@ const char* FindFiles::NextFile() {
 #else
 
 FindFiles::FindFiles( const char *_directory ) {
+       char endChar;
        directory = _directory;
+       if (directory.GetLength() > 0) {
+               endChar = directory.GetAt(directory.GetLength() - 1);
+               if (!(endChar == '/' || endChar == '\\')) {
+                       // We're only using '/' as the path separator throughout this code, not '\'.
+                       // However, I'd hate to see the code silently fail due to a trailing '\', so
+                       // I added the check for it.
+                       directory += '/';
+               }
+       }
        directory += '*';
        findHandle = INVALID_HANDLE_VALUE;
 }