[Freeswitch-svn] [commit] r12952 - freeswitch/trunk/libs/esl
FreeSWITCH SVN
mrene at freeswitch.org
Wed Apr 8 09:48:51 PDT 2009
Author: mrene
Date: Wed Apr 8 11:48:51 2009
New Revision: 12952
Log:
ESL-13
Modified:
freeswitch/trunk/libs/esl/fs_cli.c
Modified: freeswitch/trunk/libs/esl/fs_cli.c
==============================================================================
--- freeswitch/trunk/libs/esl/fs_cli.c (original)
+++ freeswitch/trunk/libs/esl/fs_cli.c Wed Apr 8 11:48:51 2009
@@ -140,10 +140,20 @@
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
More information about the Freeswitch-svn
mailing list