]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
ESL-13
authorMathieu Rene <mrene@avgs.ca>
Wed, 8 Apr 2009 16:48:51 +0000 (16:48 +0000)
committerMathieu Rene <mrene@avgs.ca>
Wed, 8 Apr 2009 16:48:51 +0000 (16:48 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12952 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/esl/fs_cli.c

index 6a44579e7e5776247692bfed41db4fcd2e7ba808..9e81083a97ddc38ba294ba66dbf9d650aad19fae 100644 (file)
@@ -140,10 +140,20 @@ static unsigned char console_f12key(EditLine * el, int ch)
 
 static unsigned char console_eofkey(EditLine * el, int ch)
 {
-       printf("/exit\n\n");
-       running = thread_running = 0;
-
-       return CC_EOF;
+       LineInfo *line;
+       /* only exit if empty line */
+       line = (LineInfo *)el_line(el);
+       if (line->buffer == line->lastchar) {
+               printf("/exit\n\n");
+               running = thread_running = 0;
+               return CC_EOF;
+       } else {
+               if (line->cursor != line->lastchar) {
+                       line->cursor++;
+                       el_deletestr(el, 1);
+               }
+               return CC_REDISPLAY;
+       }
 }
 
 #endif