mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-25 15:39:09 +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:
2
os2.c
2
os2.c
@@ -356,6 +356,8 @@ char *FiosBrowseTo(const FiosItem *item)
|
|||||||
|
|
||||||
case FIOS_TYPE_DIRECT:
|
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;
|
break;
|
||||||
|
|
||||||
case FIOS_TYPE_FILE:
|
case FIOS_TYPE_FILE:
|
||||||
|
4
unix.c
4
unix.c
@@ -312,7 +312,9 @@ char *FiosBrowseTo(const FiosItem *item)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case FIOS_TYPE_DIRECT:
|
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;
|
break;
|
||||||
|
|
||||||
case FIOS_TYPE_FILE:
|
case FIOS_TYPE_FILE:
|
||||||
|
3
win32.c
3
win32.c
@@ -919,6 +919,9 @@ char *FiosBrowseTo(const FiosItem *item)
|
|||||||
|
|
||||||
case FIOS_TYPE_DIRECT:
|
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;
|
break;
|
||||||
|
|
||||||
case FIOS_TYPE_FILE:
|
case FIOS_TYPE_FILE:
|
||||||
|
Reference in New Issue
Block a user