From af5c3afa91cc29268c6754ea70f15cae30f22403 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Mon, 27 Jan 2014 10:12:12 -0400 Subject: compat: add canonicalize_file_name the POSIX 2008 behaviour of realpath is not available everywhere so we provide a simple wrapper function. We use (and provide) the gnu extension canonicalize_file_name to make it cleaner to test for the feature we need; otherwise we have to rely on realpath segfaulting if the second argument is null. --- compat/have_canonicalize_file_name.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 compat/have_canonicalize_file_name.c (limited to 'compat/have_canonicalize_file_name.c') diff --git a/compat/have_canonicalize_file_name.c b/compat/have_canonicalize_file_name.c new file mode 100644 index 00000000..24c848ec --- /dev/null +++ b/compat/have_canonicalize_file_name.c @@ -0,0 +1,10 @@ +#define _GNU_SOURCE +#include + +int main() +{ + char *found; + char *string; + + found = canonicalize_file_name (string); +} -- cgit v1.2.3