summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorAmaury Pouly <pamaury@rockbox.org>2010-02-01 22:45:27 +0000
committerAmaury Pouly <pamaury@rockbox.org>2010-02-01 22:45:27 +0000
commite9b3c906221f41dae4f7329426b48fa206153dd2 (patch)
treeeb1316d6fcb6e5895facf23e06b78a1a5b693f50 /uisimulator
parent47dbdf4cf8e3f5576c504f5db0b1567ab3391f0d (diff)
downloadrockbox-e9b3c906221f41dae4f7329426b48fa206153dd2.tar.gz
rockbox-e9b3c906221f41dae4f7329426b48fa206153dd2.tar.bz2
rockbox-e9b3c906221f41dae4f7329426b48fa206153dd2.zip
FS#10954: fix rename under simulator by Alex Bennee
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24443 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/common/io.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c
index d87e331970..d3fe1a997f 100644
--- a/uisimulator/common/io.c
+++ b/uisimulator/common/io.c
@@ -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 */