1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-18 20:19:11 +00:00

(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:
Darkvater
2005-10-28 00:18:57 +00:00
parent f561993112
commit 9bbf8ea9d0
3 changed files with 8 additions and 1 deletions

2
os2.c
View File

@@ -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
View File

@@ -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:

View File

@@ -919,6 +919,9 @@ 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: