notmuch/compat/canonicalize_file_name.c
David Bremner f7130468d2 Import notmuch_0.28.2.orig.tar.gz
[dgit import orig notmuch_0.28.2.orig.tar.gz]
2019-02-17 07:30:33 -04:00

18 lines
377 B
C

#include "compat.h"
#include <limits.h>
#undef _GNU_SOURCE
#include <stdlib.h>
char *
canonicalize_file_name (const char * path)
{
#ifdef PATH_MAX
char *resolved_path = malloc (PATH_MAX+1);
if (resolved_path == NULL)
return NULL;
return realpath (path, resolved_path);
#else
#error undefined PATH_MAX _and_ missing canonicalize_file_name not supported
#endif
}