mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-01 11:59:26 +00:00
(svn r12847) -Cleanup: Identing and variable scope
This commit is contained in:
parent
39a715f1f3
commit
fff763b5ce
@ -108,7 +108,6 @@ StringID FiosGetDescText(const char **path, uint32 *total_free)
|
||||
* @return a string if we have given a file as a target, otherwise NULL */
|
||||
char *FiosBrowseTo(const FiosItem *item)
|
||||
{
|
||||
char *s;
|
||||
char *path = _fios_path;
|
||||
|
||||
switch (item->type) {
|
||||
@ -118,9 +117,9 @@ char *FiosBrowseTo(const FiosItem *item)
|
||||
case FIOS_TYPE_DRIVE: sprintf(path, "%c:" PATHSEP, item->title[0]); break;
|
||||
#endif
|
||||
|
||||
case FIOS_TYPE_PARENT:
|
||||
case FIOS_TYPE_PARENT: {
|
||||
/* Check for possible NULL ptr (not required for UNIXes, but AmigaOS-alikes) */
|
||||
s = strrchr(path, PATHSEPCHAR);
|
||||
char *s = strrchr(path, PATHSEPCHAR);
|
||||
if (s != NULL && s != path) {
|
||||
s[0] = '\0'; // Remove last path separator character, so we can go up one level.
|
||||
}
|
||||
@ -131,6 +130,7 @@ char *FiosBrowseTo(const FiosItem *item)
|
||||
else if ((s = strrchr(path, ':')) != NULL) s[1] = '\0';
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
case FIOS_TYPE_DIR:
|
||||
strcat(path, item->name);
|
||||
|
Loading…
Reference in New Issue
Block a user