Patch submitted by: Michael Carns To use: % cd sftpd-1.40 % patch < eof.patch.txt Here's a quick patch to detect eofs on the command line and translate them to the quit command. It correctly avoids the infinite loop that normally happens when you hit ^D. Tested on Linux 2.2.12-20, gcc version egcs-2.91.66. --BEGIN PATCHFILE-- --- sftpc.cpp.orig Tue Apr 4 02:19:37 2000 +++ sftpc.cpp Tue Apr 4 02:32:50 2000 @@ -2541,6 +2541,13 @@ string input; cin >> input; + //Detect EOF and translate it to an exit command + if (cin.eof()) + { + input = "quit"; + } + //End EOF modifications + try { userCommand(input); } --END PATCHFILE--