]> git.cworth.org Git - notmuch/blob - compat/canonicalize_file_name.c
devel/man-to-mdwn.pl: portable locale environment variable setting
[notmuch] / compat / canonicalize_file_name.c
1 #include "compat.h"
2 #include <limits.h>
3 #undef _GNU_SOURCE
4 #include <stdlib.h>
5
6 char *
7 canonicalize_file_name (const char * path)
8 {
9 #ifdef PATH_MAX
10     char *resolved_path =  malloc (PATH_MAX+1);
11     if (resolved_path == NULL)
12         return NULL;
13
14     return realpath (path, resolved_path);
15 #else
16 #error undefined PATH_MAX _and_ missing canonicalize_file_name not supported
17 #endif
18 }