From f3c2e0305652654836b39167ae44c92397c02143 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Fri, 12 Sep 2003 09:44:02 +0000 Subject: [PATCH] r3019: Don't create a corrupted pinboard/panel file if a non-UTF8 pathname is dragged to it (reported by Eugeni Andreechtchev). --- ROX-Filer/Help/Changes | 5 +++++ ROX-Filer/src/icon.c | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ROX-Filer/Help/Changes b/ROX-Filer/Help/Changes index 7e544a81..fc1ef38a 100644 --- a/ROX-Filer/Help/Changes +++ b/ROX-Filer/Help/Changes @@ -2,6 +2,11 @@ A RISC OS-like filer for X by Thomas Leonard +12-Sep-2003 +~~~~~~~~~~~ +Don't create a corrupted pinboard/panel file if a non-UTF8 pathname is +dragged to it (reported by Eugeni Andreechtchev). + 05-Sep-2003 ~~~~~~~~~~~ Added Czech translation (Jan Provaznik). diff --git a/ROX-Filer/src/icon.c b/ROX-Filer/src/icon.c index cb572f3c..042059e8 100644 --- a/ROX-Filer/src/icon.c +++ b/ROX-Filer/src/icon.c @@ -398,13 +398,16 @@ void icon_set_path(Icon *icon, const char *pathname, const char *name) if (pathname) { - icon->src_path = g_strdup(pathname); - icon->path = expand_path(pathname); + if (g_utf8_validate(pathname, -1, NULL)) + icon->src_path = g_strdup(pathname); + else + icon->src_path = to_utf8(pathname); + icon->path = expand_path(icon->src_path); icon_hash_path(icon); if (!name) - name = g_basename(pathname); + name = g_basename(icon->src_path); icon->item = diritem_new(name); diritem_restat(icon->path, icon->item, NULL); -- 2.11.4.GIT