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
90b4af03
Commit
90b4af03
authored
Jan 08, 2007
by
J. Alexander Treuman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving pathConvCharset to charConv.c so it can be reused for localization.
git-svn-id:
https://svn.musicpd.org/mpd/trunk@5226
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
bcb493cf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
charConv.c
src/charConv.c
+7
-0
charConv.h
src/charConv.h
+2
-0
path.c
src/path.c
+2
-9
No files found.
src/charConv.c
View file @
90b4af03
...
@@ -150,6 +150,13 @@ char *convStrDup(char *string)
...
@@ -150,6 +150,13 @@ char *convStrDup(char *string)
return
NULL
;
return
NULL
;
}
}
char
*
convCharset
(
char
*
to
,
char
*
from
,
char
*
str
,
char
*
ret
)
{
if
(
ret
)
free
(
ret
);
return
setCharSetConversion
(
to
,
from
)
?
NULL
:
convStrDup
(
str
);
}
static
void
closeCharSetConversion
(
void
)
static
void
closeCharSetConversion
(
void
)
{
{
if
(
char_conv_to
)
{
if
(
char_conv_to
)
{
...
...
src/charConv.h
View file @
90b4af03
...
@@ -25,4 +25,6 @@ int setCharSetConversion(char *to, char *from);
...
@@ -25,4 +25,6 @@ int setCharSetConversion(char *to, char *from);
char
*
convStrDup
(
char
*
string
);
char
*
convStrDup
(
char
*
string
);
char
*
convCharset
(
char
*
to
,
char
*
from
,
char
*
str
,
char
*
ret
);
#endif
#endif
src/path.c
View file @
90b4af03
...
@@ -36,18 +36,11 @@ const char *musicDir;
...
@@ -36,18 +36,11 @@ const char *musicDir;
static
const
char
*
playlistDir
;
static
const
char
*
playlistDir
;
static
char
*
fsCharset
=
NULL
;
static
char
*
fsCharset
=
NULL
;
static
char
*
pathConvCharset
(
char
*
to
,
char
*
from
,
char
*
str
,
char
*
ret
)
{
if
(
ret
)
free
(
ret
);
return
setCharSetConversion
(
to
,
from
)
?
NULL
:
convStrDup
(
str
);
}
char
*
fsCharsetToUtf8
(
char
*
str
)
char
*
fsCharsetToUtf8
(
char
*
str
)
{
{
static
char
*
ret
=
NULL
;
static
char
*
ret
=
NULL
;
ret
=
pathC
onvCharset
(
"UTF-8"
,
fsCharset
,
str
,
ret
);
ret
=
c
onvCharset
(
"UTF-8"
,
fsCharset
,
str
,
ret
);
if
(
ret
&&
!
validUtf8String
(
ret
))
{
if
(
ret
&&
!
validUtf8String
(
ret
))
{
free
(
ret
);
free
(
ret
);
...
@@ -61,7 +54,7 @@ char *utf8ToFsCharset(char *str)
...
@@ -61,7 +54,7 @@ char *utf8ToFsCharset(char *str)
{
{
static
char
*
ret
=
NULL
;
static
char
*
ret
=
NULL
;
ret
=
pathC
onvCharset
(
fsCharset
,
"UTF-8"
,
str
,
ret
);
ret
=
c
onvCharset
(
fsCharset
,
"UTF-8"
,
str
,
ret
);
if
(
!
ret
)
if
(
!
ret
)
ret
=
xstrdup
(
str
);
ret
=
xstrdup
(
str
);
...
...
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