diff options
Diffstat (limited to 'uisimulator')
-rw-r--r-- | uisimulator/common/filesystem-sim.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/uisimulator/common/filesystem-sim.c b/uisimulator/common/filesystem-sim.c index 7a3418021e..786f17e644 100644 --- a/uisimulator/common/filesystem-sim.c +++ b/uisimulator/common/filesystem-sim.c | |||
@@ -307,9 +307,12 @@ int sim_get_os_path(char *buffer, const char *path, size_t bufsize) | |||
307 | #ifdef HAVE_MULTIVOLUME | 307 | #ifdef HAVE_MULTIVOLUME |
308 | if (level != 1) | 308 | if (level != 1) |
309 | break; /* Volume spec only valid @ root level */ | 309 | break; /* Volume spec only valid @ root level */ |
310 | if (p[-1] != PATH_SEPCH) | ||
311 | break; | ||
310 | 312 | ||
311 | const char *next; | 313 | const char *next; |
312 | volume = path_strip_volume(p, &next, true); | 314 | volume = path_strip_volume(p-1, &next, true); |
315 | |||
313 | if (volume == ROOT_VOLUME) | 316 | if (volume == ROOT_VOLUME) |
314 | volume = 0; /* FIXME: root no longer implies volume 0 */ | 317 | volume = 0; /* FIXME: root no longer implies volume 0 */ |
315 | 318 | ||
@@ -831,7 +834,7 @@ int os_volume_path(IF_MV(int volume, ) char *buffer, size_t bufsize) | |||
831 | char volname[VOL_MAX_LEN + 1]; | 834 | char volname[VOL_MAX_LEN + 1]; |
832 | get_volume_name(volume, volname); | 835 | get_volume_name(volume, volname); |
833 | 836 | ||
834 | if (path_append(tmpbuf, PA_SEP_HARD, volname, sizeof (volname)) | 837 | if (path_append(tmpbuf, PA_SEP_HARD, volname, sizeof (tmpbuf)) |
835 | >= sizeof (volname)) | 838 | >= sizeof (volname)) |
836 | return -1; | 839 | return -1; |
837 | #endif /* HAVE_MULTIVOLUME */ | 840 | #endif /* HAVE_MULTIVOLUME */ |