diff options
author | tron <tron@openttd.org> | 2006-06-27 21:25:53 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-06-27 21:25:53 +0000 |
commit | 2b27073156f40df263cf653263488b8d72a76236 (patch) | |
tree | 1bfdb9c99b43fdc3b07ac13cbed4259a06d34f6f /unix.c | |
parent | c126ce110ee33bffe07dac5283d8a1648dc662b7 (diff) | |
download | openttd-2b27073156f40df263cf653263488b8d72a76236.tar.xz |
(svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular
Diffstat (limited to 'unix.c')
-rw-r--r-- | unix.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -302,10 +302,11 @@ char *FiosBrowseTo(const FiosItem *item) switch (item->type) { case FIOS_TYPE_PARENT: s = strrchr(path, '/'); - if (s != path) + if (s != path) { s[0] = '\0'; - else + } else { s[1] = '\0'; + } break; case FIOS_TYPE_DIR: @@ -351,8 +352,9 @@ StringID FiosGetDescText(const char **path, uint32 *tot) if (statvfs(*path, &s) == 0) { free = (uint64)s.f_frsize * s.f_bavail >> 20; - } else + } else { return STR_4006_UNABLE_TO_READ_DRIVE; + } } #endif if (tot != NULL) *tot = free; @@ -364,10 +366,7 @@ void FiosMakeSavegameName(char *buf, const char *name, size_t size) const char* extension; const char* period; - if (_game_mode == GM_EDITOR) - extension = ".scn"; - else - extension = ".sav"; + extension = (_game_mode == GM_EDITOR ? ".scn" : ".sav"); // Don't append the extension, if it is already there period = strrchr(name, '.'); @@ -458,8 +457,8 @@ int CDECL main(int argc, char* argv[]) #ifdef WITH_COCOA cocoaSetupAutoreleasePool(); - /* This is passed if we are launched by double-clicking */ - if (argc >= 2 && strncmp (argv[1], "-psn", 4) == 0) { + /* This is passed if we are launched by double-clicking */ + if (argc >= 2 && strncmp(argv[1], "-psn", 4) == 0) { argv[1] = NULL; argc = 1; cocoaSetWorkingDirectory(); |