From 28f95f9caa527c5733095aba58e1d8f08e9f3fd1 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sun, 1 Feb 2004 22:55:30 +0000 Subject: [PATCH] when calculating the length of the expanded path, add the length of the 2004-02-01 Michael Natterer * app/config/gimpconfig-path.c (gimp_config_path_expand_only): when calculating the length of the expanded path, add the length of the UTF-8 converted substitution, not its length in filesystem encoding. Finally enables GIMP2_DIRECTORY containing non-ascii chars (at least on linux). Should fix bug #130118. --- ChangeLog | 8 ++++++++ app/config/gimpconfig-path.c | 5 +++-- libgimpconfig/gimpconfig-path.c | 5 +++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b2877a32e..97a9fc29b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-02-01 Michael Natterer + + * app/config/gimpconfig-path.c (gimp_config_path_expand_only): + when calculating the length of the expanded path, add the length + of the UTF-8 converted substitution, not its length in filesystem + encoding. Finally enables GIMP2_DIRECTORY containing non-ascii + chars (at least on linux). Should fix bug #130118. + 2004-02-01 Michael Natterer Disallow to rename the layer mask. Instead, always name the mask diff --git a/app/config/gimpconfig-path.c b/app/config/gimpconfig-path.c index 4c9085ca88..d4fde004ba 100644 --- a/app/config/gimpconfig-path.c +++ b/app/config/gimpconfig-path.c @@ -161,9 +161,10 @@ gimp_config_path_expand_only (const gchar *path, substs[2*n_substs] = token; substs[2*n_substs + 1] = (gchar *) gimp_filename_to_utf8 (s); - n_substs++; - length += strlen (s); + length += strlen (substs[2*n_substs + 1]); + + n_substs++; } else { diff --git a/libgimpconfig/gimpconfig-path.c b/libgimpconfig/gimpconfig-path.c index 4c9085ca88..d4fde004ba 100644 --- a/libgimpconfig/gimpconfig-path.c +++ b/libgimpconfig/gimpconfig-path.c @@ -161,9 +161,10 @@ gimp_config_path_expand_only (const gchar *path, substs[2*n_substs] = token; substs[2*n_substs + 1] = (gchar *) gimp_filename_to_utf8 (s); - n_substs++; - length += strlen (s); + length += strlen (substs[2*n_substs + 1]); + + n_substs++; } else {