The path_canon function
Description
#include <mba/path.h> int path_canon(const unsigned char *src, const unsigned char *slim, unsigned char *dst, unsigned char *dlim, int srcsep, int dstsep);
Specifically, canonicalization will eliminate '.' and '..' components in paths in the conventional way as well as normalize redundant separators. The presence or lack of an initial and/or trailing separator is preserved. The following lists some examples of paths before and after canonicalization:
before after . .. / / /. / ./ ../ .../ .../ a/.. abc/../ a/b/c a/b/c /a/b/c /a/b/c /./a/b/c /a/b/c /../a/b/c /a/b/c ..a/b/c ..a/b/c a/b/c/ a/b/c/ a/b/c/.. a/b/ a/b/c/../ a/b/ a/b/c/./ a/b/c/Returns