From 6a0f0c2bfbffde9b2b838d78b81b7d9b27f81b61 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 28 Nov 2008 05:09:21 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20561807=20=E2=80=93=20inotify=5Fsub.c=20::?= =?UTF-8?q?=20dup=5Fdirname()=20fails=20to=20remove=20trailing=20'/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-11-28 Matthias Clasen Bug 561807 – inotify_sub.c :: dup_dirname() fails to remove trailing '/' * inotify/inotify-sub.c (dup_dirname): Actually strip the trailing '/' away. Spotted by Dan Williams. ` svn path=/trunk/; revision=7682 --- gio/ChangeLog | 8 ++++++++ gio/inotify/inotify-sub.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gio/ChangeLog b/gio/ChangeLog index 97c3ea668..af3503e72 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,11 @@ +2008-11-28 Matthias Clasen + + Bug 561807 – inotify_sub.c :: dup_dirname() fails to remove trailing + '/' + + * inotify/inotify-sub.c (dup_dirname): Actually strip the trailing + '/' away. Spotted by Dan Williams. + 2008-11-21 Cosimo Cecchi Bug 561375 – Leaks mountpoint description diff --git a/gio/inotify/inotify-sub.c b/gio/inotify/inotify-sub.c index 404dc208e..2b71c930d 100644 --- a/gio/inotify/inotify-sub.c +++ b/gio/inotify/inotify-sub.c @@ -38,8 +38,8 @@ dup_dirname (const gchar *dirname) gchar *d_dirname = g_strdup (dirname); size_t len = strlen (d_dirname); - if (d_dirname[len] == '/') - d_dirname[len] = '\0'; + if (d_dirname[len - 1] == '/') + d_dirname[len - 1] = '\0'; return d_dirname; }