summaryrefslogtreecommitdiff
path: root/os2.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-27 21:25:53 +0000
committertron <tron@openttd.org>2006-06-27 21:25:53 +0000
commit2b27073156f40df263cf653263488b8d72a76236 (patch)
tree1bfdb9c99b43fdc3b07ac13cbed4259a06d34f6f /os2.c
parentc126ce110ee33bffe07dac5283d8a1648dc662b7 (diff)
downloadopenttd-2b27073156f40df263cf653263488b8d72a76236.tar.xz
(svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular
Diffstat (limited to 'os2.c')
-rw-r--r--os2.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/os2.c b/os2.c
index fec84bc79..efc42221f 100644
--- a/os2.c
+++ b/os2.c
@@ -64,10 +64,11 @@ int compare_FiosItems(const void *a, const void *b)
static void append_path(char *out, const char *path, const char *file)
{
- if (path[2] == '\\' && path[3] == '\0')
+ if (path[2] == '\\' && path[3] == '\0') {
sprintf(out, "%s%s", path, file);
- else
+ } else {
sprintf(out, "%s\\%s", path, file);
+ }
}
// Get a list of savegames
@@ -347,10 +348,11 @@ char *FiosBrowseTo(const FiosItem *item)
case FIOS_TYPE_PARENT:
s = strrchr(path, '\\');
- if (s != path + 2)
+ if (s != path + 2) {
s[0] = '\0';
- else
+ } else {
s[1] = '\0';
+ }
break;
case FIOS_TYPE_DIR:
@@ -406,10 +408,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, '.');