]> Git repositories of Nishi - rbuild.git/commitdiff
send macro properly master
authorNishi <nishi@nishi.boats>
Sat, 12 Oct 2024 02:54:00 +0000 (02:54 +0000)
committerNishi <nishi@nishi.boats>
Sat, 12 Oct 2024 02:54:00 +0000 (02:54 +0000)
git-svn-id: file:///raid/svn-personal/rbuild/trunk@27 c68d3453-7f82-0740-9748-1d72386a946b

Client/main.c

index 89adb0b1035f96b73ef4533cf8516136aa32a2bd..7f90b489e6814cb5595189a4e34a51826dbfe079 100644 (file)
@@ -164,8 +164,16 @@ int main(int argc, char** argv) {
                                        send(sock, "CC", 2, 0);
                                }
                                for(j = start; j < argc; j++) {
-                                       send(sock, " ", 1, 0);
-                                       send(sock, argv[j], strlen(argv[j]), 0);
+                                       int k;
+                                       send(sock, " \"", 2, 0);
+                                       for(k = 0; argv[j][k] != 0; k++){
+                                               if(argv[j][k] == '"'){
+                                                       send(sock, "\\\"", 2, 0);
+                                               }else{
+                                                       send(sock, argv[j] + k, 1, 0);
+                                               }
+                                       }
+                                       send(sock, "\"", 1, 0);
                                }
                                send(sock, "\n", 1, 0);
                                phase++;