diff options
author | Avuton Olrich <avuton@gmail.com> | 2006-07-13 18:09:25 +0000 |
---|---|---|
committer | Avuton Olrich <avuton@gmail.com> | 2006-07-13 18:09:25 +0000 |
commit | fca9a92ba6310a069bed10fd8d4620a93a399b15 (patch) | |
tree | c0e444054574b5724e58d51fba0bb7ee3a2820f9 /src | |
parent | db2f8439952c771ca1d560df9057c81ed4ca8293 (diff) | |
download | mpd-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 '')
-rw-r--r-- | src/path.c | 19 | ||||
-rw-r--r-- | src/path.h | 2 | ||||
-rw-r--r-- | src/utf8.c | 6 |
3 files changed, 8 insertions, 19 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); diff --git a/src/path.h b/src/path.h index 34b726f6f..ff8372142 100644 --- a/src/path.h +++ b/src/path.h @@ -51,6 +51,4 @@ char * parentPath(char * path); /* strips extra "///" and leading "/" and trailing "/" */ char * sanitizePathDup(char * path); -char * prependCwdToPathDup(char * path); - #endif diff --git a/src/utf8.c b/src/utf8.c index 2c0c20a5f..4e284f6c1 100644 --- a/src/utf8.c +++ b/src/utf8.c @@ -22,7 +22,7 @@ #include <string.h> #include <stdlib.h> -unsigned char * latin1ToUtf8(unsigned char c) { +static unsigned char * latin1ToUtf8(unsigned char c) { static unsigned char utf8[3]; memset(utf8,0,3); @@ -63,7 +63,7 @@ unsigned char * latin1StrToUtf8Dup(unsigned char * latin1) { return realloc(ret,len+1); } -unsigned char utf8ToLatin1(unsigned char * utf8) { +static unsigned char utf8ToLatin1(unsigned char * utf8) { unsigned char c = 0; if(utf8[0]<128) return utf8[0]; @@ -72,7 +72,7 @@ unsigned char utf8ToLatin1(unsigned char * utf8) { return c+utf8[1]; } -int validateUtf8Char(unsigned char * utf8Char) { +static int validateUtf8Char(unsigned char * utf8Char) { if(utf8Char[0]<0x80) return 1; if(utf8Char[0]>=0xC0 && utf8Char[0]<=0xFD) { |