forked from len0rd/rockbox
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
This commit is contained in:
parent
1b39f2e117
commit
c04f497670
2 changed files with 8 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -1202,6 +1202,10 @@ static int fat_checkname(const unsigned char* newname)
|
|||
return -1;
|
||||
newname++;
|
||||
}
|
||||
/* check trailing space(s) */
|
||||
if(*(--newname) == ' ')
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue