summaryrefslogtreecommitdiff
path: root/apps/misc.c
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2022-08-16 13:10:13 +0200
committerChristian Soffke <christian.soffke@gmail.com>2023-01-14 12:14:28 -0500
commit7f265ee8dd062a015e214b16f9c41fc27e867f22 (patch)
tree87ba5da95ef7870c922fd7206640c976ad72794a /apps/misc.c
parentcc79f1b543535e8d7e5b9875af9043c16267e429 (diff)
downloadrockbox-7f265ee8dd062a015e214b16f9c41fc27e867f22.tar.gz
rockbox-7f265ee8dd062a015e214b16f9c41fc27e867f22.zip
Database: Add ability to insert multiple files into playlists
You could only add single files to playlists from the database browser before. This enables adding any database selection to a new or existing playlist. Change-Id: I811c7167641c589944bb2afc18dcc1d299a7b979
Diffstat (limited to 'apps/misc.c')
-rw-r--r--apps/misc.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/apps/misc.c b/apps/misc.c
index 93b5247ae9..e6c8a219ea 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -1387,6 +1387,32 @@ int string_option(const char *option, const char *const oplist[], bool ignore_ca
1387 return -1; 1387 return -1;
1388} 1388}
1389 1389
1390/* Make sure part of path only contain chars valid for a FAT32 long name.
1391 * Double quotes are replaced with single quotes, other unsupported chars
1392 * are replaced with an underscore.
1393 *
1394 * path - path to modify.
1395 * offset - where in path to start checking.
1396 * count - number of chars to check.
1397 */
1398void fix_path_part(char* path, int offset, int count)
1399{
1400 static const char invalid_chars[] = "*/:<>?\\|";
1401 int i;
1402
1403 path += offset;
1404
1405 for (i = 0; i <= count; i++, path++)
1406 {
1407 if (*path == 0)
1408 return;
1409 if (*path == '"')
1410 *path = '\'';
1411 else if (strchr(invalid_chars, *path))
1412 *path = '_';
1413 }
1414}
1415
1390/* open but with a builtin printf for assembling the path */ 1416/* open but with a builtin printf for assembling the path */
1391int open_pathfmt(char *buf, size_t size, int oflag, const char *pathfmt, ...) 1417int open_pathfmt(char *buf, size_t size, int oflag, const char *pathfmt, ...)
1392{ 1418{