aboutsummaryrefslogtreecommitdiffstats
path: root/src/path.c
diff options
context:
space:
mode:
authorAvuton Olrich <avuton@gmail.com>2006-07-13 18:09:25 +0000
committerAvuton Olrich <avuton@gmail.com>2006-07-13 18:09:25 +0000
commitfca9a92ba6310a069bed10fd8d4620a93a399b15 (patch)
treec0e444054574b5724e58d51fba0bb7ee3a2820f9 /src/path.c
parentdb2f8439952c771ca1d560df9057c81ed4ca8293 (diff)
downloadmpd-fca9a92ba6310a069bed10fd8d4620a93a399b15.tar.gz
mpd-fca9a92ba6310a069bed10fd8d4620a93a399b15.tar.xz
mpd-fca9a92ba6310a069bed10fd8d4620a93a399b15.zip
path.*: cleanups
utf8.c: add some static's git-svn-id: https://svn.musicpd.org/mpd/trunk@4311 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/path.c')
-rw-r--r--src/path.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/path.c b/src/path.c
index ad8cbfa1f..0fc5a1eb7 100644
--- a/src/path.c
+++ b/src/path.c
@@ -42,23 +42,16 @@ char * playlistDir;
char * fsCharset = NULL;
-char * pathConvCharset(char * to, char * from, char * str, char * ret) {
- if(ret) {
- free(ret);
- ret = NULL;
- }
-
+static char * pathConvCharset(char * to, char * from, char * str) {
if(setCharSetConversion(to,from)==0) {
- ret = convStrDup(str);
+ return convStrDup(str);
}
- return ret;
+ return NULL;
}
char * fsCharsetToUtf8(char * str) {
- static char * ret = NULL;
-
- ret = pathConvCharset("UTF-8",fsCharset,str,ret);
+ char * ret = pathConvCharset("UTF-8",fsCharset,str);
if(ret && !validUtf8String(ret)) {
free(ret);
@@ -69,9 +62,7 @@ char * fsCharsetToUtf8(char * str) {
}
char * utf8ToFsCharset(char * str) {
- static char * ret = NULL;
-
- ret = pathConvCharset(fsCharset,"UTF-8",str,ret);
+ char * ret = pathConvCharset(fsCharset,"UTF-8",str);
if(!ret) ret = strdup(str);