diff options
author | Kalle Wallin <kaw@linux.se> | 2004-03-29 18:15:45 +0000 |
---|---|---|
committer | Kalle Wallin <kaw@linux.se> | 2004-03-29 18:15:45 +0000 |
commit | 8c7736fc1ad24bafcc178e4363cc49a1c4e57494 (patch) | |
tree | da9fba7ecf15f4acb372e112799bb1b48d3db5fc /support.c | |
parent | 4ec34bcde02a6bd4cbf3e7b8db2adcad1d48689c (diff) | |
download | mpd-8c7736fc1ad24bafcc178e4363cc49a1c4e57494.tar.gz mpd-8c7736fc1ad24bafcc178e4363cc49a1c4e57494.tar.xz mpd-8c7736fc1ad24bafcc178e4363cc49a1c4e57494.zip |
Removed the concat_path() function.
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@540 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'support.c')
-rw-r--r-- | support.c | 47 |
1 files changed, 14 insertions, 33 deletions
@@ -70,33 +70,6 @@ lowerstr(char *str) } -char * -concat_path(char *p1, char *p2) -{ - size_t size; - char *path; - char append_slash = 0; - - size = strlen(p1); - if( size==0 || p1[size-1]!='/' ) - { - size++; - append_slash = 1; - } - size += strlen(p2); - size++; - - path = g_malloc0(size*sizeof(char)); - g_strlcpy(path, p1, size); - if( append_slash ) - g_strlcat(path, "/", size); - g_strlcat(path, p2, size); - - return path; -} - - - #ifndef HAVE_BASENAME char * basename(char *path) @@ -155,19 +128,27 @@ charset_close(void) } char * -utf8_to_locale(char *str) +utf8_to_locale(char *utf8str) { + char *str; + if( noconvert ) - return g_strdup(str); - return g_locale_from_utf8(str, -1, NULL, NULL, NULL); + return g_strdup(utf8str); + if( (str=g_locale_from_utf8(utf8str, -1, NULL, NULL, NULL)) == NULL ) + return g_strdup(utf8str); + return str; } char * -locale_to_utf8(char *str) +locale_to_utf8(char *localestr) { + char *str; + if( noconvert ) - return g_strdup(str); - return g_locale_to_utf8(str, -1, NULL, NULL, NULL); + return g_strdup(localestr); + if( (str=g_locale_to_utf8(localestr, -1, NULL, NULL, NULL)) == NULL ) + return g_strdup(localestr); + return str; } |