Index: TSRM/tsrm_virtual_cwd.c =================================================================== RCS file: /repository/TSRM/tsrm_virtual_cwd.c,v retrieving revision 1.74.2.7 diff -u -p -d -r1.74.2.7 tsrm_virtual_cwd.c --- TSRM/tsrm_virtual_cwd.c 6 Feb 2006 20:37:11 -0000 1.74.2.7 +++ TSRM/tsrm_virtual_cwd.c 7 Feb 2006 15:21:45 -0000 @@ -1035,6 +1035,26 @@ CWD_API FILE *virtual_popen(const char * #endif +/* On AIX & Tru64 when a file does not exist realpath() returns + * NULL, and sets errno to ENOENT. Unlike in other libc implementations + * the destination is not filled and remains undefined. Therefor, we + * must populate it manually using strcpy as done on systems with no + * realpath() function. + */ +#if defined(__osf__) || defined(_AIX) +char *php_realpath_hack(char *src, char *dest) +{ + char *ret; + + if ((ret = realpath(src, dest)) == NULL && errno == ENOENT) { + return strcpy(dest, src); + } else { + return ret; + } +} +#endif + + /* * Local variables: Index: TSRM/tsrm_virtual_cwd.h =================================================================== RCS file: /repository/TSRM/tsrm_virtual_cwd.h,v retrieving revision 1.48.2.2 diff -u -p -d -r1.48.2.2 tsrm_virtual_cwd.h --- TSRM/tsrm_virtual_cwd.h 16 Jan 2006 09:09:37 -0000 1.48.2.2 +++ TSRM/tsrm_virtual_cwd.h 7 Feb 2006 15:21:45 -0000 @@ -166,23 +166,8 @@ CWD_API int virtual_access(const char *p #endif #endif -/* On AIX & Tru64 when a file does not exist realpath() returns - * NULL, and sets errno to ENOENT. Unlike in other libc implementations - * the destination is not filled and remains undefined. Therefor, we - * must populate it manually using strcpy as done on systems with no - * realpath() function. - */ #if defined(__osf__) || defined(_AIX) -static char *php_realpath_hack(char *src, char *dest) -{ - char *ret; - - if ((ret = realpath(src, dest)) == NULL && errno == ENOENT) { - return strcpy(dest, src); - } else { - return ret; - } -} +char *php_realpath_hack(char *src, char *dest); #endif #if HAVE_UTIME