Commit Graph

4 Commits

Author SHA1 Message Date
H. Peter Anvin
9e122a6603 realpath: if we can't get the full path, return the known portion
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>
2016-02-18 01:53:47 -08:00
H. Peter Anvin
d7043da281 realpath: prefer the buffer size given by pathconf()
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>
2016-02-12 01:32:57 -08:00
H. Peter Anvin
064af69d62 realpath.c: remove testing #ifdef unintentionally left in
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>
2016-01-27 14:28:32 -08:00
H. Peter Anvin
4627e695a5 Portability improvements to nasm_realpath()
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>
2016-01-26 12:01:34 -08:00