From: nishi Date: Thu, 13 Jun 2024 21:12:38 +0000 (+0000) Subject: quit with ctrl-d X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=7b628a785dbd05e80d1ad1bc0c99b79509d4cb04;p=dataworks.git quit with ctrl-d git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@298 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- diff --git a/RemoteClient/rcli.c b/RemoteClient/rcli.c index 0db66ba..ffe9091 100644 --- a/RemoteClient/rcli.c +++ b/RemoteClient/rcli.c @@ -160,6 +160,11 @@ int main(int _argc, char** _argv) { int ch = getchar(); #endif if(ch == EOF || ch == match) { + if(ch == EOF){ + free(username); + free(password); + goto go_quit; + } break; } else if(ch != '\r') { cbuf[0] = ch; @@ -194,6 +199,11 @@ int main(int _argc, char** _argv) { int ch = getchar(); #endif if(ch == EOF || ch == match) { + if(ch == EOF){ + free(username); + free(password); + goto go_quit; + } break; } else if(ch != '\r') { cbuf[0] = ch;