aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2004-03-29 18:15:45 +0000
committerKalle Wallin <kaw@linux.se>2004-03-29 18:15:45 +0000
commit8c7736fc1ad24bafcc178e4363cc49a1c4e57494 (patch)
treeda9fba7ecf15f4acb372e112799bb1b48d3db5fc
parent4ec34bcde02a6bd4cbf3e7b8db2adcad1d48689c (diff)
downloadmpd-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
-rw-r--r--support.c47
-rw-r--r--support.h2
2 files changed, 14 insertions, 35 deletions
diff --git a/support.c b/support.c
index 488b4cc53..becd60b31 100644
--- a/support.c
+++ b/support.c
@@ -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;
}
diff --git a/support.h b/support.h
index adba8a05d..f94936ce5 100644
--- a/support.h
+++ b/support.h
@@ -3,8 +3,6 @@
#include <libgen.h>
#endif
-char *concat_path(char *p1, char *p2);
-
#ifndef HAVE_BASENAME
char *basename(char *path);
#endif