Right now, we don't check the return value from nasm_realpath();
furthermore doing so and failing is probably not the ideal behavior.
If we can't get the full canonical path, then punt and just return
nasm_strdup() of the known path name; better than nothing.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
If realpath(..., NULL) doesn't work, we have to allocate a buffer
blindly. Use the value returned from pathconf() in preference from
compile-time constants.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Remove the #if 0 for canonicalize_file_name(). This was added to
test the realpath() code, and inadvertently left in.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Try harder to nasm_realpath() to be as portable as possible. Move it
to a separate file since it has gotten complex enough that it is
cleaner that way.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>