mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
talk: Make talk_fullpath() do the right thing when voicing a directory
The component after the final '/' can be a directory, so don't unconditionally treat it as a file. Also check to make sure there is something after the final '/' otherwise we end up voicing it as '//' Change-Id: I56d69ea3f299e524df29c328ec9eeb3cfc22ff42
This commit is contained in:
parent
c5e1539c74
commit
d5a4230901
1 changed files with 12 additions and 2 deletions
12
apps/talk.c
12
apps/talk.c
|
@ -1232,9 +1232,19 @@ int talk_fullpath(const char* path, bool enqueue)
|
||||||
ptr = strchr(start, PATH_SEPCH);
|
ptr = strchr(start, PATH_SEPCH);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* no more slashes, final component is a filename */
|
/* no more slashes, figure out final component */
|
||||||
|
if (!*start) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
DIR* dir = opendir(buf);
|
||||||
|
if (dir) {
|
||||||
|
closedir(dir);
|
||||||
|
return talk_dir_or_spell(buf, NULL, true);
|
||||||
|
} else {
|
||||||
return talk_file_or_spell(NULL, buf, NULL, true);
|
return talk_file_or_spell(NULL, buf, NULL, true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* say a numeric value, this word ordering works for english,
|
/* say a numeric value, this word ordering works for english,
|
||||||
but not necessarily for other languages (e.g. german) */
|
but not necessarily for other languages (e.g. german) */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue