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
2c45224b
Commit
2c45224b
authored
Jan 25, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mapper: added dot to PLAYLIST_FILE_SUFFIX
Some code will be a little bit simpler if the dot is part of the string literal.
parent
7cc15ffc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
9 deletions
+6
-9
mapper.c
src/mapper.c
+1
-1
mapper.h
src/mapper.h
+1
-1
stored_playlist.c
src/stored_playlist.c
+4
-7
No files found.
src/mapper.c
View file @
2c45224b
...
...
@@ -203,7 +203,7 @@ map_spl_path(void)
char
*
map_spl_utf8_to_fs
(
const
char
*
name
)
{
char
*
filename
=
g_strconcat
(
name
,
"."
PLAYLIST_FILE_SUFFIX
,
NULL
);
char
*
filename
=
g_strconcat
(
name
,
PLAYLIST_FILE_SUFFIX
,
NULL
);
char
*
path
;
if
(
playlist_dir
==
NULL
)
...
...
src/mapper.h
View file @
2c45224b
...
...
@@ -25,7 +25,7 @@
#include <stdbool.h>
#define PLAYLIST_FILE_SUFFIX "m3u"
#define PLAYLIST_FILE_SUFFIX "
.
m3u"
struct
directory
;
struct
song
;
...
...
src/stored_playlist.c
View file @
2c45224b
...
...
@@ -42,14 +42,11 @@ load_playlist_info(const char *parent_path_fs, const char *name_fs)
struct
stat
st
;
struct
stored_playlist_info
*
playlist
;
if
(
name_length
<
1
+
sizeof
(
PLAYLIST_FILE_SUFFIX
)
||
if
(
name_length
<
sizeof
(
PLAYLIST_FILE_SUFFIX
)
||
memchr
(
name_fs
,
'\n'
,
name_length
)
!=
NULL
)
return
NULL
;
if
(
name_fs
[
name_length
-
sizeof
(
PLAYLIST_FILE_SUFFIX
)]
!=
'.'
||
memcmp
(
name_fs
+
name_length
-
sizeof
(
PLAYLIST_FILE_SUFFIX
)
+
1
,
PLAYLIST_FILE_SUFFIX
,
sizeof
(
PLAYLIST_FILE_SUFFIX
)
-
1
)
!=
0
)
if
(
!
g_str_has_suffix
(
name_fs
,
PLAYLIST_FILE_SUFFIX
))
return
NULL
;
path_fs
=
g_build_filename
(
parent_path_fs
,
name_fs
,
NULL
);
...
...
@@ -58,8 +55,8 @@ load_playlist_info(const char *parent_path_fs, const char *name_fs)
if
(
ret
<
0
||
!
S_ISREG
(
st
.
st_mode
))
return
NULL
;
name
=
g_str
dup
(
name_fs
);
name
[
name_length
-
sizeof
(
PLAYLIST_FILE_SUFFIX
)]
=
0
;
name
=
g_str
ndup
(
name_fs
,
name_length
+
1
-
sizeof
(
PLAYLIST_FILE_SUFFIX
))
;
name_utf8
=
fs_charset_to_utf8
(
name
);
g_free
(
name
);
if
(
name_utf8
==
NULL
)
...
...
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