forked from len0rd/rockbox
Doubleslash eradication
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3427 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e86629158e
commit
10abfec207
1 changed files with 23 additions and 16 deletions
39
apps/tree.c
39
apps/tree.c
|
@ -697,10 +697,10 @@ static int onplay_screen(char* dir, char* file)
|
||||||
struct entry* f = &dircache[dirstart + dircursor];
|
struct entry* f = &dircache[dirstart + dircursor];
|
||||||
bool isdir = f->attr & ATTR_DIRECTORY;
|
bool isdir = f->attr & ATTR_DIRECTORY;
|
||||||
|
|
||||||
if ((dir[0]=='/') && (dir[1]==0))
|
if (dir[1])
|
||||||
snprintf(buf, sizeof buf, "%s%s", dir, file);
|
|
||||||
else
|
|
||||||
snprintf(buf, sizeof buf, "%s/%s", dir, file);
|
snprintf(buf, sizeof buf, "%s/%s", dir, file);
|
||||||
|
else
|
||||||
|
snprintf(buf, sizeof buf, "/%s", file);
|
||||||
|
|
||||||
lcd_clear_display();
|
lcd_clear_display();
|
||||||
|
|
||||||
|
@ -850,11 +850,11 @@ static int onplay_screen(char* dir, char* file)
|
||||||
int m_handle;
|
int m_handle;
|
||||||
int selected;
|
int selected;
|
||||||
|
|
||||||
if ((dir[0]=='/') && (dir[1]==0))
|
if (dir[1])
|
||||||
snprintf(buf, sizeof buf, "%s%s", dir, file);
|
|
||||||
else
|
|
||||||
snprintf(buf, sizeof buf, "%s/%s", dir, file);
|
snprintf(buf, sizeof buf, "%s/%s", dir, file);
|
||||||
|
else
|
||||||
|
snprintf(buf, sizeof buf, "/%s", dir, file);
|
||||||
|
|
||||||
if (playing) {
|
if (playing) {
|
||||||
items[lastitem].desc=str(LANG_QUEUE);
|
items[lastitem].desc=str(LANG_QUEUE);
|
||||||
ids[lastitem]=1;
|
ids[lastitem]=1;
|
||||||
|
@ -1096,11 +1096,10 @@ bool dirbrowse(char *root)
|
||||||
#endif
|
#endif
|
||||||
if ( !numentries )
|
if ( !numentries )
|
||||||
break;
|
break;
|
||||||
if ((currdir[0]=='/') && (currdir[1]==0)) {
|
if (currdir[1])
|
||||||
snprintf(buf,sizeof(buf),"%s%s",currdir, file->name);
|
|
||||||
} else {
|
|
||||||
snprintf(buf,sizeof(buf),"%s/%s",currdir, file->name);
|
snprintf(buf,sizeof(buf),"%s/%s",currdir, file->name);
|
||||||
}
|
else
|
||||||
|
snprintf(buf,sizeof(buf),"/%s",file->name);
|
||||||
|
|
||||||
if (file->attr & ATTR_DIRECTORY) {
|
if (file->attr & ATTR_DIRECTORY) {
|
||||||
memcpy(currdir,buf,sizeof(currdir));
|
memcpy(currdir,buf,sizeof(currdir));
|
||||||
|
@ -1120,10 +1119,15 @@ bool dirbrowse(char *root)
|
||||||
lcd_stop_scroll();
|
lcd_stop_scroll();
|
||||||
switch ( file->attr & TREE_ATTR_MASK ) {
|
switch ( file->attr & TREE_ATTR_MASK ) {
|
||||||
case TREE_ATTR_M3U:
|
case TREE_ATTR_M3U:
|
||||||
if ( global_settings.resume )
|
if ( global_settings.resume ) {
|
||||||
snprintf(global_settings.resume_file,
|
if (currdir[1])
|
||||||
MAX_PATH, "%s/%s",
|
snprintf(global_settings.resume_file,
|
||||||
currdir, file->name);
|
MAX_PATH, "%s/%s",
|
||||||
|
currdir, file->name);
|
||||||
|
else
|
||||||
|
snprintf(global_settings.resume_file,
|
||||||
|
MAX_PATH, "/%s", file->name);
|
||||||
|
}
|
||||||
play_list(currdir, file->name, 0, false, 0,
|
play_list(currdir, file->name, 0, false, 0,
|
||||||
seed, 0, 0, -1);
|
seed, 0, 0, -1);
|
||||||
start_index = 0;
|
start_index = 0;
|
||||||
|
@ -1496,7 +1500,10 @@ static bool add_dir(char* dirname, int fd)
|
||||||
if (!strcmp(entry->d_name, ".") ||
|
if (!strcmp(entry->d_name, ".") ||
|
||||||
!strcmp(entry->d_name, ".."))
|
!strcmp(entry->d_name, ".."))
|
||||||
continue;
|
continue;
|
||||||
snprintf(buf, sizeof buf, "%s/%s", dirname, entry->d_name);
|
if (dirname[1])
|
||||||
|
snprintf(buf, sizeof buf, "%s/%s", dirname, entry->d_name);
|
||||||
|
else
|
||||||
|
snprintf(buf, sizeof buf, "/%s", entry->d_name);
|
||||||
if (add_dir(buf,fd)) {
|
if (add_dir(buf,fd)) {
|
||||||
abort = true;
|
abort = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue