]> Nishi Git Mirror - tewi.git/commitdiff
just check the filename
authorNishi <nishi@nishi.boats>
Thu, 19 Sep 2024 09:35:56 +0000 (09:35 +0000)
committerNishi <nishi@nishi.boats>
Thu, 19 Sep 2024 09:35:56 +0000 (09:35 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@73 8739d7e6-ffea-ec47-b151-bdff447c6205

Server/server.c

index e8ab79a8ffa7c0386f1024ced3e0236363a14b56..fc3a11cf627484bbb1f5440ead6b00bd90942a91 100644 (file)
@@ -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]);