aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl/posix
diff options
context:
space:
mode:
authorJohannes Schickel2016-01-29 19:09:46 +0100
committerJohannes Schickel2016-02-02 09:16:40 +0100
commitb4e360188f49cda286a3a707e87fa41b437cd179 (patch)
treef46ce2566fa68cc98f0840a39088ef312bdebd23 /backends/platform/sdl/posix
parent589c3046aa033a02ff6c54ea55bc0840617c6d32 (diff)
downloadscummvm-rg350-b4e360188f49cda286a3a707e87fa41b437cd179.tar.gz
scummvm-rg350-b4e360188f49cda286a3a707e87fa41b437cd179.tar.bz2
scummvm-rg350-b4e360188f49cda286a3a707e87fa41b437cd179.zip
POSIX: Restructure code in OSystem_POSIX::createLogFile.
Diffstat (limited to 'backends/platform/sdl/posix')
-rw-r--r--backends/platform/sdl/posix/posix.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp
index b2a8e14e40..8b065e131a 100644
--- a/backends/platform/sdl/posix/posix.cpp
+++ b/backends/platform/sdl/posix/posix.cpp
@@ -167,26 +167,33 @@ Common::WriteStream *OSystem_POSIX::createLogFile() {
// of a failure, we know that no log file is open.
_logFilePath.clear();
- const char *home = getenv("HOME");
- if (home == NULL)
- return 0;
-
+ const char *prefix = nullptr;
Common::String logFile;
#ifdef MACOSX
+ prefix = getenv("HOME");
+ if (prefix == nullptr) {
+ return 0;
+ }
+
logFile = "Library/Logs";
#elif SAMSUNGTV
- home = nullptr;
+ prefix = nullptr;
logFile = "/mtd_ram";
#else
+ prefix = getenv("HOME");
+ if (prefix == nullptr) {
+ return 0;
+ }
+
logFile = ".scummvm/logs";
#endif
- if (!assureDirectoryExists(logFile, home)) {
+ if (!assureDirectoryExists(logFile, prefix)) {
return 0;
}
- if (home) {
- logFile = Common::String::format("%s/%s", home, logFile.c_str());
+ if (prefix) {
+ logFile = Common::String::format("%s/%s", prefix, logFile.c_str());
}
logFile += "/scummvm.log";