[PATCH] fix ngx_realpath() for win32
Won-Kyu Park
wkpark at gmail.com
Tue Nov 1 11:15:48 UTC 2022
# HG changeset patch
# User Won-Kyu Park <wkpark at gmail.com>
# Date 1667298839 -32400
# Tue Nov 01 19:33:59 2022 +0900
# Node ID c964b33d60679f5cd8d43a8f859d16c2ac6f89e1
# Parent 1ae25660c0c76edef14121ca64362f28b9d57a70
fix ngx_realpath() for win32
diff -r 1ae25660c0c7 -r c964b33d6067 src/os/win32/ngx_files.c
--- a/src/os/win32/ngx_files.c Wed Oct 19 10:56:21 2022 +0300
+++ b/src/os/win32/ngx_files.c Tue Nov 01 19:33:59 2022 +0900
@@ -416,14 +416,6 @@
}
-u_char *
-ngx_realpath(u_char *path, u_char *resolved)
-{
- /* STUB */
- return path;
-}
-
-
ngx_int_t
ngx_open_dir(ngx_str_t *name, ngx_dir_t *dir)
{
diff -r 1ae25660c0c7 -r c964b33d6067 src/os/win32/ngx_files.h
--- a/src/os/win32/ngx_files.h Wed Oct 19 10:56:21 2022 +0300
+++ b/src/os/win32/ngx_files.h Tue Nov 01 19:33:59 2022 +0900
@@ -172,7 +172,7 @@
void ngx_close_file_mapping(ngx_file_mapping_t *fm);
-u_char *ngx_realpath(u_char *path, u_char *resolved);
+#define ngx_realpath(path, resolved) (u_char *)_fullpath((char
*)(resolved), (char *)(path), MAX_PATH)
#define ngx_realpath_n ""
#define ngx_getcwd(buf, size) GetCurrentDirectory(size, (char *) buf)
#define ngx_getcwd_n "GetCurrentDirectory()"
---- END --------
This small fix would set $realpath_root as expected for win32.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20221101/a8a64efe/attachment.htm>
More information about the nginx-devel
mailing list