]> Nishi Git Mirror - dataworks.git/commitdiff
quit with ctrl-d
authornishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Thu, 13 Jun 2024 21:12:38 +0000 (21:12 +0000)
committernishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Thu, 13 Jun 2024 21:12:38 +0000 (21:12 +0000)
git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@298 d4a5a174-5a4a-5b4b-b672-37683c10d7d5

RemoteClient/rcli.c

index 0db66ba714fe362116a36c647321e5c21a43459e..ffe9091d4094b0f28a6820916cebe32ba9e21ce8 100644 (file)
@@ -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;