From 3e7c459a7969daef0c8e84ca074587003172cb90 Mon Sep 17 00:00:00 2001 From: rambetter Date: Mon, 13 Dec 2010 04:50:40 +0000 Subject: [PATCH] ixing a big problem on Windows platforms that has to do with copying over game packs to the game install directory. Before this patch, users of Radiant weren't able to start Radiant without doing some manual copying of game pack files over by hand (and I'm sure nobody figured that out). The problem is in radiant/missing.cpp. CopyTree() didn't correctly recursively copy directories because of a problem in FindFiles::FindFiles() on Windows. git-svn-id: https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/trunk@346 8a3a26a2-13c4-0310-b231-cf6edde360e5 --- radiant/missing.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/radiant/missing.cpp b/radiant/missing.cpp index e610fbb0..24694683 100644 --- a/radiant/missing.cpp +++ b/radiant/missing.cpp @@ -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; } -- 2.39.2