summaryrefslogtreecommitdiff
path: root/firmware/common/pathfuncs.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2017-01-07 07:12:10 -0500
committerMichael Sevakis <jethead71@rockbox.org>2017-01-07 19:10:02 -0500
commit5c6ccb43b55d70350869429da25e2b54b45086d3 (patch)
treef06266c8ade82f36e7e3360ceca313c8b4adaf80 /firmware/common/pathfuncs.c
parent5a0a7b8b58a02192e5087077acf9e66fbdf1966e (diff)
downloadrockbox-5c6ccb43b55d70350869429da25e2b54b45086d3.tar.gz
rockbox-5c6ccb43b55d70350869429da25e2b54b45086d3.zip
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/common/pathfuncs.c')
-rw-r--r--firmware/common/pathfuncs.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/firmware/common/pathfuncs.c b/firmware/common/pathfuncs.c
index 1ee5fe9886..f5674983d9 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)
197 return -1; 197 return -1;
198} 198}
199 199
200/* Strips leading and trailing whitespace from a path
201 * " a/b \txyz" *nameptr->a, len=3: "a/b"
202 */
203size_t path_trim_whitespace(const char *name, const char **nameptr)
204{
205 /* NOTE: this won't currently treat DEL (0x7f) as non-printable */
206 const unsigned char *p = name;
207 int c;
208
209 while ((c = *p) <= ' ' && c)
210 ++p;
211
212 const unsigned char *first = p;
213 const unsigned char *last = p;
214
215 while (1)
216 {
217 if (c < ' ')
218 {
219 *nameptr = first;
220 return last - first;
221 }
222
223 while ((c = *++p) > ' ');
224 last = p;
225 while (c == ' ') c = *++p;
226 }
227}
228
229/* Strips directory components from the path 200/* Strips directory components from the path
230 * "" *nameptr->NUL, len=0: "" 201 * "" *nameptr->NUL, len=0: ""
231 * "/" *nameptr->/, len=1: "/" 202 * "/" *nameptr->/, len=1: "/"