diff options
| author | Björn Stenberg <bjorn@haxx.se> | 2003-03-10 14:54:23 +0000 |
|---|---|---|
| committer | Björn Stenberg <bjorn@haxx.se> | 2003-03-10 14:54:23 +0000 |
| commit | 22cbe938feb48895d7488449835d3ee577399057 (patch) | |
| tree | ad8d38292fb9b5668c90ed5082d9ff9c888a25f2 /apps/tree.c | |
| parent | d0b4e2a9bd117696862081139cfa2f0916683336 (diff) | |
| download | rockbox-22cbe938feb48895d7488449835d3ee577399057.zip rockbox-22cbe938feb48895d7488449835d3ee577399057.tar.gz rockbox-22cbe938feb48895d7488449835d3ee577399057.tar.bz2 rockbox-22cbe938feb48895d7488449835d3ee577399057.tar.xz | |
Don't allow renaming to ''.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3409 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tree.c')
| -rw-r--r-- | apps/tree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/tree.c b/apps/tree.c index eebf788..677f930 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -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)); |