FS#10954: fix rename under simulator by Alex Bennee

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24443 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Amaury Pouly 2010-02-01 22:45:27 +00:00
parent 47dbdf4cf8
commit e9b3c90622

View file

@ -418,10 +418,15 @@ int sim_remove(const char *name)
int sim_rename(const char *oldname, const char *newname)
{
char sim_old[MAX_PATH];
char sim_new[MAX_PATH];
#ifdef HAVE_DIRCACHE
dircache_rename(oldname, newname);
#endif
return RENAME(get_sim_pathname(oldname), get_sim_pathname(newname));
// This is needed as get_sim_pathname() has a static buffer
strncpy(sim_old, get_sim_pathname(oldname), MAX_PATH);
strncpy(sim_new, get_sim_pathname(newname), MAX_PATH);
return RENAME(sim_old, sim_new);
}
/* rockbox off_t may be different from system off_t */