aboutsummaryrefslogtreecommitdiffstats
path: root/daemon/pathnames.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--daemon/pathnames.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/daemon/pathnames.c b/daemon/pathnames.c
index 932c854..8d4b09a 100644
--- a/daemon/pathnames.c
+++ b/daemon/pathnames.c
@@ -81,14 +81,16 @@ void create_directories( gchar* pathname )
* normalize_pathname
*
* Remove . and .. from pathname.
- * Return NULL if pathname is invalid.
+ * Pathname should be in UTF-8 encoding.
+ * Return NULL if pathname is invalid or normalized pathname
+ * in locale encoding.
*/
gchar* normalize_pathname( const gchar* pathname )
{
- gchar *ret = g_strdup( pathname );
+ gchar *ret = g_locale_from_utf8( pathname, -1, NULL, NULL, NULL );
gchar *first_element, *current_element, *next_element;
- TRACE_ENTER( "%s\n", pathname );
+ TRACE_ENTER( "%s\n", ret );
first_element = (gchar*) g_path_skip_root( ret );
if( !first_element )