g_canonicalize_filename() is broken
Canonicalising /foo/symlink/../baz
should give different results based on whether symlink
is a symlink or not. ..
should be resolved after following the symlink.
Similarly, syscalls behave differently if given a path with a trailing slash. If a path has a trailing slash, syscalls do an implicit ‘is a directory’ check. We need to be more explicit about whether we return results with a trailing slash.
I think this means g_canonicalize_filename()
needs to do I/O (to resolve symlinks).
(As pointed out by Lennart.)