From: Nishi Date: Sat, 12 Oct 2024 02:54:00 +0000 (+0000) Subject: send macro properly X-Git-Url: https://git.chaotic.ninja/gitweb/nishi/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=rbuild.git send macro properly git-svn-id: file:///raid/svn-personal/rbuild/trunk@27 c68d3453-7f82-0740-9748-1d72386a946b --- diff --git a/Client/main.c b/Client/main.c index 89adb0b..7f90b48 100644 --- a/Client/main.c +++ b/Client/main.c @@ -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++;