From 47fc157fd25dc961204990af6a2ffb53a6723f4d Mon Sep 17 00:00:00 2001 From: Nishi Date: Thu, 19 Sep 2024 09:35:56 +0000 Subject: [PATCH] just check the filename git-svn-id: file:///raid/svn-personal/tewi/trunk@73 8739d7e6-ffea-ec47-b151-bdff447c6205 --- Server/server.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Server/server.c b/Server/server.c index e8ab79a..fc3a11c 100644 --- a/Server/server.c +++ b/Server/server.c @@ -487,10 +487,16 @@ void tw_server_pass(int sock, bool ssl, int port, SOCKADDR addr) { #ifdef __MINGW32__ char* rpath = cm_strdup(path); for(i = strlen(rpath) - 1; i >= 0; i--) { - if(rpath[i] != ':') { + if(rpath[i] == '/') { + int j; + for(j = i + 1; rpath[j] != 0; j++) { + if(rpath[j] == ':' || rpath[j] == '.') { + rpath[j] = 0; + break; + } + } break; } - rpath[i] = 0; } for(i = 0; i < sizeof(reserved_names) / sizeof(reserved_names[0]); i++) { char* n = cm_strcat("/", reserved_names[i]); -- 2.43.0