summaryrefslogtreecommitdiff
path: root/uisimulator/common
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/common
parent47dbdf4cf8e3f5576c504f5db0b1567ab3391f0d (diff)
downloadrockbox-e9b3c906221f41dae4f7329426b48fa206153dd2.tar.gz
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/common')
-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)
418 418
419int sim_rename(const char *oldname, const char *newname) 419int sim_rename(const char *oldname, const char *newname)
420{ 420{
421 char sim_old[MAX_PATH];
422 char sim_new[MAX_PATH];
421#ifdef HAVE_DIRCACHE 423#ifdef HAVE_DIRCACHE
422 dircache_rename(oldname, newname); 424 dircache_rename(oldname, newname);
423#endif 425#endif
424 return RENAME(get_sim_pathname(oldname), get_sim_pathname(newname)); 426 // This is needed as get_sim_pathname() has a static buffer
427 strncpy(sim_old, get_sim_pathname(oldname), MAX_PATH);
428 strncpy(sim_new, get_sim_pathname(newname), MAX_PATH);
429 return RENAME(sim_old, sim_new);
425} 430}
426 431
427/* rockbox off_t may be different from system off_t */ 432/* rockbox off_t may be different from system off_t */