mc/mc-spaceprompt.patch
2005-03-21 10:24:18 +00:00

30 lines
1.0 KiB
Diff

--- mc-4.6.1-pre3/src/main.c.jn 2005-03-19 15:55:40.000000000 +0100
+++ mc-4.6.1-pre3/src/main.c 2005-03-19 17:04:10.000000000 +0100
@@ -1490,9 +1490,14 @@ midnight_callback (struct Dlg_head *h, d
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 */
@@ -1527,7 +1532,7 @@ midnight_callback (struct Dlg_head *h, d
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
*/