GrafX2 2.9.3227
The ultimate 256-color painting program
|
Implementation of realpath() that is portable on all our platforms. More...
Functions | |
char * | Realpath (const char *_path) |
Makes an absolute filename, resolving symbolic links etc. More... | |
Implementation of realpath() that is portable on all our platforms.
char * Realpath | ( | const char * | _path | ) |
Makes an absolute filename, resolving symbolic links etc.
_path | Input path |
POSIX 2004 states : If resolved_name is a null pointer, the behavior of realpath() is implementation-defined.
but POSIX 2008 : If resolved_name is a null pointer, the generated pathname shall be stored as a null-terminated string in a buffer allocated as if by a call to malloc().
So we assume all platforms now support passing NULL. If you find a platform where this is not the case, please add a new implementation with ifdef's.
References GFX2_malloc, NULL, and PATH_MAX.
Referenced by Analyze_command_line(), Calculate_relative_path(), Extract_path(), For_each_file(), Load_INI(), and Test_Realpath().