diff options
| author | Michael Sevakis <jethead71@rockbox.org> | 2017-01-07 07:12:10 -0500 |
|---|---|---|
| committer | Michael Sevakis <jethead71@rockbox.org> | 2017-01-07 19:10:02 -0500 |
| commit | 5c6ccb43b55d70350869429da25e2b54b45086d3 (patch) | |
| tree | f06266c8ade82f36e7e3360ceca313c8b4adaf80 /firmware | |
| parent | 5a0a7b8b58a02192e5087077acf9e66fbdf1966e (diff) | |
| download | rockbox-5c6ccb43b55d70350869429da25e2b54b45086d3.zip rockbox-5c6ccb43b55d70350869429da25e2b54b45086d3.tar.gz rockbox-5c6ccb43b55d70350869429da25e2b54b45086d3.tar.bz2 rockbox-5c6ccb43b55d70350869429da25e2b54b45086d3.tar.xz | |
Fix track formatting problems in playlist.c
Some changes in behavior were made with filesystem code commit
for the sake of compatibility that changed expected behavior.
* Restore substitution of drive spec in fully-qualified DOS paths
with the playlists's volume spec (or root on univolume targets).
Drive-relative paths of the form "c:foo" (no separator after
':') will be treated as purely relative.
* Restore old behavior of preserving leading whitespace in the
source path and trimming only trailing tabs and spaces.
* Multivolume: Volume substition on fully-qualified UNIX/RB paths
has NOT been reintroduced (and perhaps wasn't intended in the
first place). They will not be modified because there is no
ambiguity to resolve. Doing so would prevent a playlist on
external storage from referencing a file on main storage without
qualifying it with "/<0>...".
* Plain relative paths are and always have been interpreted as
relative to the location of the playlist.
Change-Id: Ic0800cea79c59563b7bac20f8b08abb5051906c7
Diffstat (limited to 'firmware')
| -rw-r--r-- | firmware/common/pathfuncs.c | 29 | ||||
| -rw-r--r-- | firmware/export/pathfuncs.h | 1 |
2 files changed, 0 insertions, 30 deletions
diff --git a/firmware/common/pathfuncs.c b/firmware/common/pathfuncs.c index 1ee5fe9..f567498 100644 --- a/firmware/common/pathfuncs.c +++ b/firmware/common/pathfuncs.c @@ -197,35 +197,6 @@ int path_strip_drive(const char *name, const char **nameptr, bool greedy) return -1; } -/* Strips leading and trailing whitespace from a path - * " a/b \txyz" *nameptr->a, len=3: "a/b" - */ -size_t path_trim_whitespace(const char *name, const char **nameptr) -{ - /* NOTE: this won't currently treat DEL (0x7f) as non-printable */ - const unsigned char *p = name; - int c; - - while ((c = *p) <= ' ' && c) - ++p; - - const unsigned char *first = p; - const unsigned char *last = p; - - while (1) - { - if (c < ' ') - { - *nameptr = first; - return last - first; - } - - while ((c = *++p) > ' '); - last = p; - while (c == ' ') c = *++p; - } -} - /* Strips directory components from the path * "" *nameptr->NUL, len=0: "" * "/" *nameptr->/, len=1: "/" diff --git a/firmware/export/pathfuncs.h b/firmware/export/pathfuncs.h index 26eb4a1..92539c5 100644 --- a/firmware/export/pathfuncs.h +++ b/firmware/export/pathfuncs.h @@ -78,7 +78,6 @@ int get_volume_name(int volume, char *name); #endif int path_strip_drive(const char *name, const char **nameptr, bool greedy); -size_t path_trim_whitespace(const char *name, const char **nameptr); size_t path_basename(const char *name, const char **nameptr); size_t path_dirname(const char *name, const char **nameptr); size_t path_strip_trailing_separators(const char *name, const char **nameptr); |