main.c: Fix blocking of panel cd-ing when there are only spaces on the

command line.
This commit is contained in:
Leonard den Ottolander 2005-05-29 11:54:22 +00:00
parent 1f60f44145
commit 3be17f6657
2 changed files with 14 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2005-05-29 Jindrich Novy <jnovy@redhat.com>
* main.c (midnight_callback): Fix blocking of panel cd-ing when
there are only spaces on the command line.
2005-05-26 Roland Illig <roland.illig@gmx.de>
* view.c: Completely rewrote the cursor movement code. Now all

View File

@ -1487,9 +1487,14 @@ midnight_callback (struct Dlg_head *h, dlg_msg_t msg, int parm)
if (parm == '\t')
free_completions (cmdline);
if (parm == '\n' && cmdline->buffer[0]) {
send_message ((Widget *) cmdline, WIDGET_KEY, parm);
return MSG_HANDLED;
if (parm == '\n') {
for (i = 0; cmdline->buffer[i] && cmdline->buffer[i] == ' '; i++);
if (cmdline->buffer[i]) {
send_message ((Widget *) cmdline, WIDGET_KEY, parm);
return MSG_HANDLED;
}
stuff (cmdline, "", 0);
cmdline->point = 0;
}
/* Ctrl-Enter and Alt-Enter */
@ -1524,7 +1529,7 @@ midnight_callback (struct Dlg_head *h, dlg_msg_t msg, int parm)
reverse_selection_cmd ();
return MSG_HANDLED;
}
} else if (!command_prompt || !strlen (cmdline->buffer)) {
} else if (!command_prompt || !cmdline->buffer[0]) {
/* Special treatement '+', '-', '\', '*' only when this is
* first char on input line
*/