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

Potential Patch for vala



Hi gents,

Here is a potential patch for vala, based on some feedback from Samuel, Guillem, and Alan (thanks!).

Thanks,

Barry


diff -urN vala-0.7.2.orig/gobject-introspection/grealpath.h vala-0.7.2/gobject-introspection/grealpath.h
--- vala-0.7.2.orig/gobject-introspection/grealpath.h	2009-04-09 16:01:10.000000000 -0400
+++ vala-0.7.2/gobject-introspection/grealpath.h	2009-05-25 18:19:15.000000000 -0400
@@ -10,11 +10,23 @@
 static inline gchar*
 g_realpath (const char *path)
 {
+#ifdef (__GLIBC__) || _POSIX_VERSION >= 200809L
+	char *buffer;
+	gchar *gret;
+	if ((buffer = realpath(path, NULL) != NULL)) {
+		gret = g_strdup(buffer);
+		free(buffer);
+		return gret;
+	} else {
+		return NULL;
+	}
+#else
 	char buffer [PATH_MAX];
 	if (realpath(path, buffer))
 		return g_strdup(buffer);
 	else
 		return NULL;
+#endif
 }
 
 #endif

Reply to: