Bug 561807 – inotify_sub.c :: dup_dirname() fails to remove trailing '/'

2008-11-28  Matthias Clasen  <mclasen@redhat.com>

        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
This commit is contained in:
Matthias Clasen
2008-11-28 05:10:53 +00:00
committed by Matthias Clasen
parent 1596363fba
commit aa855eaa1d
2 changed files with 13 additions and 2 deletions

View File

@@ -1,3 +1,14 @@
2008-11-28 Matthias Clasen <mclasen@redhat.com>
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 <mclasen@redhat.com>
* === Released 2.18.3 ===

View File

@@ -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;
}