From aa855eaa1d0b556c2ec787c7addca2048ddd4ef6 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 28 Nov 2008 05:10:53 +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=/branches/glib-2-18/; revision=7683 --- gio/ChangeLog | 11 +++++++++++ gio/inotify/inotify-sub.c | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gio/ChangeLog b/gio/ChangeLog index 78dc1972c..01fc6f15b 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,14 @@ +2008-11-28 Matthias Clasen + + Merged from trunk: + + 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-24 Matthias Clasen * === Released 2.18.3 === 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; }