"Theodoros V. Kalamatianos" <address@hidden> wrote:
...
> What about using realpath() ? According to the realpath(3) manpage it
> exists on BSD, Linux, and Solaris and gives out an absolute dereferenced
> path. This could cut down significantly the necessary code.
You're right that there's already code to do that.
In coreutils, it'd be lib/canonicalize.c's canonicalize_file_name function.