1
0
Fork 0
forked from len0rd/rockbox

Don't allow renaming to ''.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3409 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2003-03-10 14:54:23 +00:00
parent d0b4e2a9bd
commit 22cbe938fe

View file

@ -710,7 +710,7 @@ static int onplay_screen(char* dir, char* file)
int pathlen = (ptr - buf);
strncpy(newname, buf, sizeof newname);
if (!kbd_input(newname + pathlen, (sizeof newname)-pathlen)) {
if (rename(buf, newname) < 0) {
if (!strlen(buf+pathlen) || (rename(buf, newname) < 0)) {
lcd_clear_display();
lcd_puts(0,0,str(LANG_RENAME));
lcd_puts(0,1,str(LANG_FAILED));