[Xfce4-commits] <thunar:master> Fix truncated strings when loading and storing emblems (bug #7171).

Jannis Pohlmann noreply at xfce.org
Mon Jan 24 18:58:01 CET 2011


Updating branch refs/heads/master
         to c231b0f266ca52be057cac23dfef12d1c2995895 (commit)
       from a78ad6084cfcb707e0a19b862e8a2f1d7bd827c1 (commit)

commit c231b0f266ca52be057cac23dfef12d1c2995895
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Mon Jan 24 18:55:16 2011 +0100

    Fix truncated strings when loading and storing emblems (bug #7171).
    
    The last character of all key names was always left out when storing the
    key/value pair in the TDB file. As a consequence, two similarly named
    files (e.g. x1 and x2) were treated the same (x) and both were assigned
    the same emblems.

 NEWS                     |    4 ++++
 thunar/thunar-metafile.c |    4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index c998af2..8928d29 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+1.3.x
+=====
+- Fix truncated strings when loading and storing emblems (bug #7171).
+
 1.2.0
 =====
 - Properly try alternative names when creating links (bug #6867).
diff --git a/thunar/thunar-metafile.c b/thunar/thunar-metafile.c
index 1d49f1e..4221296 100644
--- a/thunar/thunar-metafile.c
+++ b/thunar/thunar-metafile.c
@@ -278,7 +278,7 @@ thunar_metafile_fetch (ThunarMetafile   *metafile,
 
   /* generate the key data */
   key_data.dptr = key_path;
-  key_data.dsize = key_size - 1;
+  key_data.dsize = key_size;
 
   /* release any earlier result data */
   if (G_LIKELY (metafile->data.dptr != NULL))
@@ -373,7 +373,7 @@ thunar_metafile_store (ThunarMetafile   *metafile,
 
   /* generate the key data */
   key_data.dptr = key_path;
-  key_data.dsize = key_size - 1;
+  key_data.dsize = key_size;
 
   /* fetch the current value for the key */
   value_data = thunar_metafile_read (metafile, key_data);



More information about the Xfce4-commits mailing list