Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
47efe423
Commit
47efe423
authored
Jan 01, 2008
by
Eric Wong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make utf8_to_fs_playlist_path universally accessible
git-svn-id:
https://svn.musicpd.org/mpd/trunk@7115
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
49f8660f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
12 deletions
+15
-12
path.c
src/path.c
+8
-0
path.h
src/path.h
+7
-1
storedPlaylist.c
src/storedPlaylist.c
+0
-11
No files found.
src/path.c
View file @
47efe423
...
...
@@ -22,6 +22,7 @@
#include "conf.h"
#include "utf8.h"
#include "utils.h"
#include "playlist.h"
#include <stdlib.h>
#include <string.h>
...
...
@@ -278,3 +279,10 @@ char *sanitizePathDup(char *path)
return
xrealloc
(
ret
,
len
+
1
);
}
void
utf8_to_fs_playlist_path
(
char
*
path_max_tmp
,
const
char
*
utf8path
)
{
utf8_to_fs_charset
(
path_max_tmp
,
(
char
*
)
utf8path
);
rpp2app_r
(
path_max_tmp
,
path_max_tmp
);
strncat
(
path_max_tmp
,
"."
PLAYLIST_FILE_SUFFIX
,
MPD_PATH_MAX
-
1
);
}
src/path.h
View file @
47efe423
...
...
@@ -75,7 +75,13 @@ char *sanitizePathDup(char *path);
/* this is actually like strlcpy (OpenBSD), but we don't actually want to
* blindly use it everywhere, only for paths that are OK to truncate (for
* error reporting and such.
* dest must be M
AXPATHLEN+1
bytes large (which is standard in mpd) */
* dest must be M
PD_PATH_MAX
bytes large (which is standard in mpd) */
void
pathcpy_trunc
(
char
*
dest
,
const
char
*
src
);
/*
* converts a path passed from a client into an absolute FS path.
* paths passed by clients do NOT have file suffixes in them
*/
void
utf8_to_fs_playlist_path
(
char
*
path_max_tmp
,
const
char
*
utf8path
);
#endif
src/storedPlaylist.c
View file @
47efe423
...
...
@@ -52,17 +52,6 @@ static int valid_playlist_name(int err_fd, const char *utf8path)
return
1
;
}
/*
* converts a path passed from a client into an absolute, FS path
* paths passed by clients do NOT have file suffixes in them
*/
static
void
utf8_to_fs_playlist_path
(
char
*
path_max_tmp
,
const
char
*
utf8path
)
{
utf8_to_fs_charset
(
path_max_tmp
,
(
char
*
)
utf8path
);
rpp2app_r
(
path_max_tmp
,
path_max_tmp
);
strncat
(
path_max_tmp
,
"."
PLAYLIST_FILE_SUFFIX
,
MPD_PATH_MAX
-
1
);
}
static
unsigned
int
lengthOfStoredPlaylist
(
StoredPlaylist
*
sp
)
{
return
sp
->
list
->
numberOfNodes
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment