From: Stanislav Malyshev Date: Tue, 30 Sep 2003 09:48:53 +0000 (+0000) Subject: MF4: add realpath function for win32 X-Git-Tag: RELEASE_1_3b2~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1a773f17d35626c95b3ec1b2c16050241e71ef2f;p=php MF4: add realpath function for win32 --- diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index a8a8274f45..1095787193 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -374,4 +374,13 @@ TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf) { return -1; } } + +TSRM_API char *realpath(char *orig_path, char *buffer) +{ + int ret = GetFullPathName(orig_path, _MAX_PATH, buffer, NULL); + if(!ret || ret > _MAX_PATH) { + return NULL; + } + return buffer; +} #endif diff --git a/TSRM/tsrm_win32.h b/TSRM/tsrm_win32.h index 303e105203..ffed2d559e 100644 --- a/TSRM/tsrm_win32.h +++ b/TSRM/tsrm_win32.h @@ -102,4 +102,5 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags); TSRM_API int shmdt(const void *shmaddr); TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf); -#endif \ No newline at end of file +TSRM_API char *realpath(char *orig_path, char *buffer); +#endif