mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r3097) - Fix (regression): unix has a trailing slash after the paths, windows does not, no idea why os2 has. Way to go consistency :s. So anyways, just strip trailing slash
This commit is contained in:
parent
f561993112
commit
9bbf8ea9d0
2
os2.c
2
os2.c
|
@ -356,6 +356,8 @@ char *FiosBrowseTo(const FiosItem *item)
|
|||
|
||||
case FIOS_TYPE_DIRECT:
|
||||
sprintf(path, "%s\\", item->name);
|
||||
s = strrchr(path, '\\');
|
||||
if (s[1] == '\0') s[0] = '\0'; // strip trailing slash
|
||||
break;
|
||||
|
||||
case FIOS_TYPE_FILE:
|
||||
|
|
4
unix.c
4
unix.c
|
@ -312,7 +312,9 @@ char *FiosBrowseTo(const FiosItem *item)
|
|||
break;
|
||||
|
||||
case FIOS_TYPE_DIRECT:
|
||||
sprintf(path, "%s\\", item->name);
|
||||
sprintf(path, "%s/", item->name);
|
||||
s = strrchr(path, '/');
|
||||
if (s[1] == '\0') s[0] = '\0'; // strip trailing slash
|
||||
break;
|
||||
|
||||
case FIOS_TYPE_FILE:
|
||||
|
|
Loading…
Reference in New Issue