From ad5495ca45b8690c09c06f1222582f725863fe24 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Fri, 18 Jan 2013 22:07:11 -0800 Subject: [PATCH] Fix issues from review --- Sources/Plasma/Apps/plClient/plClient.cpp | 8 ++++---- Sources/Plasma/CoreLib/plFileSystem.cpp | 5 +++-- Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Sources/Plasma/Apps/plClient/plClient.cpp b/Sources/Plasma/Apps/plClient/plClient.cpp index bc51c341..a3d7ca34 100644 --- a/Sources/Plasma/Apps/plClient/plClient.cpp +++ b/Sources/Plasma/Apps/plClient/plClient.cpp @@ -2346,10 +2346,10 @@ void plClient::IDetectAudioVideoSettings() #ifndef PLASMA_EXTERNAL_RELEASE // internal builds can use the local dir - if (plFileInfo("init//audio.ini").Exists()) - audioIniFile = "init//audio.ini"; - if (plFileInfo("init//graphics.ini").Exists()) - graphicsIniFile = "init//graphics.ini"; + if (plFileInfo("init/audio.ini").Exists()) + audioIniFile = "init/audio.ini"; + if (plFileInfo("init/graphics.ini").Exists()) + graphicsIniFile = "init/graphics.ini"; #endif //check to see if audio.ini exists diff --git a/Sources/Plasma/CoreLib/plFileSystem.cpp b/Sources/Plasma/CoreLib/plFileSystem.cpp index 071a32fc..f0dfcd9a 100644 --- a/Sources/Plasma/CoreLib/plFileSystem.cpp +++ b/Sources/Plasma/CoreLib/plFileSystem.cpp @@ -51,6 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com # include # include # include +# include #endif #include #include "plProduct.h" @@ -162,7 +163,7 @@ plFileName plFileName::AbsolutePath() const path = plString::FromWchar(path_sm); } #else - char *path_a = realpath(path.c_str(), nullptr); + char *path_a = realpath(path.fName.c_str(), nullptr); hsAssert(path_a, "Failure to get absolute path (unsupported libc?)"); path = path_a; free(path_a); @@ -307,7 +308,7 @@ bool plFileSystem::Copy(const plFileName &from, const plFileName &to) count = fread(buffer, sizeof(uint8_t), arrsize(buffer), ffrom.get()); if (ferror(ffrom.get())) return false; - fwrite(data, sizeof(uint8_t), count, fto.get()); + fwrite(buffer, sizeof(uint8_t), count, fto.get()); } return true; diff --git a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp index caa42557..8a43a260 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp @@ -651,7 +651,7 @@ bool plSecureStream::IsSecureFile(const plFileName& fileName) FILE_ATTRIBUTE_NORMAL, // normal file attributes NULL); // no template #elif HS_BUILD_FOR_UNIX - fp = plFileSystem::Open(fileName); + fp = plFileSystem::Open(fileName, "rb"); #endif if (fp == INVALID_HANDLE_VALUE)