From f5e75663fef044cad02eef3eb7aef295312c1158 Mon Sep 17 00:00:00 2001
From: Laurent Bercot
+ size_t path_canonicalize (char *out, char const *in, int check)
+Writes into out the canonical form of the Unix path given in
+in. The out array must be preallocated with at least
+strlen(in)+2 bytes. Returns the length of the out path, without
+counting the terminating null byte. If check is nonzero, in is tested
+for every foobar/.. element, and the function returns 0, and sets errno
+appropriately, if foobar is not a valid directory; in that case, out
+contains the problematic path.
+