From cc39d70726f3db5fc8893a7351e831eaad8c975d Mon Sep 17 00:00:00 2001 From: Nishi Date: Sat, 12 Oct 2024 02:54:00 +0000 Subject: [PATCH] send macro properly git-svn-id: file:///raid/svn-personal/rbuild/trunk@27 c68d3453-7f82-0740-9748-1d72386a946b --- Client/main.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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++; -- 2.43.0