From 7b628a785dbd05e80d1ad1bc0c99b79509d4cb04 Mon Sep 17 00:00:00 2001 From: nishi Date: Thu, 13 Jun 2024 21:12:38 +0000 Subject: [PATCH] quit with ctrl-d git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@298 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- RemoteClient/rcli.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; -- 2.43.0