From c04f4976703e516d69f03ce3f9045ed73ac4fcdb Mon Sep 17 00:00:00 2001 From: Peter D'Hoye Date: Thu, 7 Feb 2008 22:15:13 +0000 Subject: Let the FAT namecheck also look for trailing spaces, fixes FS #8560. Only call the dircache rename function if the actual rename was ok. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16241 a1c6a512-1295-4272-9138-f99709370657 --- firmware/common/file.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'firmware/common') diff --git a/firmware/common/file.c b/firmware/common/file.c index f0437f9..613eba9 100644 --- a/firmware/common/file.c +++ b/firmware/common/file.c @@ -385,9 +385,6 @@ int rename(const char* path, const char* newpath) return - 5; file = &openfiles[fd]; -#ifdef HAVE_DIRCACHE - dircache_rename(path, newpath); -#endif rc = fat_rename(&file->fatfile, &dir->fatdir, nameptr, file->size, file->attr); @@ -404,6 +401,10 @@ int rename(const char* path, const char* newpath) return rc * 10 - 7; } +#ifdef HAVE_DIRCACHE + dircache_rename(path, newpath); +#endif + rc = close(fd); if (rc<0) { errno = EIO; -- cgit v1.1