From 4cc9761cb5d7dd6e4b9b4e9676f856a6357e7dbc Mon Sep 17 00:00:00 2001 From: Darkvater Date: Fri, 28 Oct 2005 00:18:57 +0000 Subject: (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 --- os2.c | 2 ++ unix.c | 4 +++- win32.c | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/os2.c b/os2.c index 821ebf206..6aa5a61ca 100644 --- a/os2.c +++ b/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: diff --git a/unix.c b/unix.c index c9dcee80b..fd20e3715 100644 --- a/unix.c +++ b/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: diff --git a/win32.c b/win32.c index 8ef1caa81..68ef27705 100644 --- a/win32.c +++ b/win32.c @@ -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: -- cgit v1.2.3-70-g09d2