[librsvg] portability: canonicalize_file_name -> realpath



commit 02cb19835cb52bd84b0b5eaca1b4d6338417d261
Author: Antoine Jacoutot <ajacoutot gnome org>
Date:   Tue Oct 15 09:36:30 2013 +0200

    portability: canonicalize_file_name -> realpath
    
    canonicalize_file_name() is a GNU extension so let's use the portable
    realpath() instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710163

 rsvg-base.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/rsvg-base.c b/rsvg-base.c
index cb9f64a..fb829e7 100644
--- a/rsvg-base.c
+++ b/rsvg-base.c
@@ -50,6 +50,8 @@
 #include <math.h>
 #include <string.h>
 #include <stdarg.h>
+#include <limits.h>
+#include <stdlib.h>
 
 #include "rsvg-path.h"
 #include "rsvg-paint-server.h"
@@ -2190,8 +2192,7 @@ _rsvg_handle_allow_load (RsvgHandle *handle,
     dir = g_file_get_path (base);
     g_object_unref (base);
 
-    /* FIXME portability */
-    cdir = canonicalize_file_name (dir);
+    cdir = realpath (dir, NULL);
     g_free (dir);
     if (cdir == NULL)
         goto deny;
@@ -2200,8 +2201,7 @@ _rsvg_handle_allow_load (RsvgHandle *handle,
     if (path == NULL)
         goto deny;
 
-    /* FIXME portability */
-    cpath = canonicalize_file_name (path);
+    cpath = realpath (path, NULL);
     g_free (path);
 
     if (cpath == NULL)


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