notmuch.git  about / heads / tags
Unnamed repository; edit this file 'description' to name the repository.
blob 000f9e781573e92b50bef8708962bffa0e08f2d6 378 bytes (raw)
name: compat/canonicalize_file_name.c 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
 
#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
}

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

git clone https://yhetil.org/notmuch.git