[librsvg] Fix crash while saving as svg.



commit 2647e45742d430d39ade332747494b287b9ea0bf
Author: Christian Persch <chpe gnome org>
Date:   Sat Apr 10 16:32:35 2010 +0900

    Fix crash while saving as svg.
    
    Part of fix for bug #591766.
    The return value of basename should not be free. We can use
    g_path_get_basename instead.

 configure.in   |    2 +-
 test-display.c |   12 ++----------
 2 files changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/configure.in b/configure.in
index 055981e..9d9d896 100644
--- a/configure.in
+++ b/configure.in
@@ -183,7 +183,7 @@ AC_SUBST([LIBRSVG_HAVE_CSS],[$croco_define])
 
 dnl ===========================================================================
 
-AC_CHECK_FUNCS(strtok_r basename)
+AC_CHECK_FUNCS(strtok_r)
 
 dnl ===========================================================================
 
diff --git a/test-display.c b/test-display.c
index be469c5..21d1a97 100644
--- a/test-display.c
+++ b/test-display.c
@@ -30,10 +30,6 @@
 #include <gdk/gdk.h>
 #include <gdk/gdkkeysyms.h>
 
-#ifdef HAVE_BASENAME
-#include <libgen.h>
-#endif
-
 #ifdef ENABLE_XEMBED
 #include <gdk/gdkx.h>
 #endif                          /* ENABLE_XEMBED */
@@ -44,12 +40,8 @@
 static char *
 _rsvg_basename (const char *file)
 {
-#ifdef HAVE_BASENAME
-    if (file && *file) {
-        char *file_dup = g_strdup (file);
-        return basename (file_dup);
-    }
-#endif
+    if (file && *file)
+	return g_path_get_basename (file);
 
     return NULL;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]