mc/mc-spaceprompt.patch
Jindrich Novy 65f3b0ed3f - update from CVS
- sync with .utf8 patch and some minor gcc4 fixups
- add .fixes patch
- drop upstreamed .spaceprompt patch
- update .userhost, .64bit patch
2005-06-06 13:25:29 +00:00

31 lines
1.1 KiB
Diff

--- mc-4.6.1a/src/main.c.spaceprompt 2005-05-26 15:06:42.285109424 +0200
+++ mc-4.6.1a/src/main.c 2005-05-26 15:15:15.964018360 +0200
@@ -1490,9 +1491,15 @@ 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] == ' ' || cmdline->buffer[i] == '\t'); 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 +1534,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
*/