1
1

* command.c (enter): Don't change current_dlg to NULL. It

breaks repainting of the panels.  Simplify logic.
Этот коммит содержится в:
Pavel Roskin 2003-10-25 04:55:51 +00:00
родитель 8c10c20881
Коммит 6da33f9c8c
2 изменённых файлов: 64 добавлений и 65 удалений

Просмотреть файл

@ -1,5 +1,8 @@
2003-10-25 Pavel Roskin <proski@gnu.org> 2003-10-25 Pavel Roskin <proski@gnu.org>
* command.c (enter): Don't change current_dlg to NULL. It
breaks repainting of the panels. Simplify logic.
* key.c (init_key_x11): Warning fix for gcc 3.3.2. * key.c (init_key_x11): Warning fix for gcc 3.3.2.
2003-10-24 Pavel Roskin <proski@gnu.org> 2003-10-24 Pavel Roskin <proski@gnu.org>

Просмотреть файл

@ -171,20 +171,22 @@ void do_cd_command (char *cmd)
} }
} }
/* Returns 1 if the we could handle the enter, 0 if not */ /* Handle Enter on the command line */
static int static cb_ret_t
enter (WInput *cmdline) enter (WInput *cmdline)
{ {
Dlg_head *old_dlg; char *cmd = cmdline->buffer;
if (command_prompt && strlen (cmdline->buffer)) { if (!command_prompt)
char *cmd; return MSG_HANDLED;
/* Any initial whitespace should be removed at this point */ /* Any initial whitespace should be removed at this point */
cmd = cmdline->buffer;
while (*cmd == ' ' || *cmd == '\t' || *cmd == '\n') while (*cmd == ' ' || *cmd == '\t' || *cmd == '\n')
cmd++; cmd++;
if (!*cmd)
return MSG_HANDLED;
if (strncmp (cmd, "cd ", 3) == 0 || strcmp (cmd, "cd") == 0) { if (strncmp (cmd, "cd ", 3) == 0 || strcmp (cmd, "cd") == 0) {
do_cd_command (cmd); do_cd_command (cmd);
new_input (cmdline); new_input (cmdline);
@ -216,8 +218,7 @@ enter (WInput *cmdline)
if (cmd[i] == '%') { if (cmd[i] == '%') {
i++; i++;
s = expand_format (NULL, cmd[i], 1); s = expand_format (NULL, cmd[i], 1);
command = command = g_realloc (command, strlen (command) + strlen (s)
g_realloc (command, strlen (command) + strlen (s)
+ strlen (cmd) - i + 1); + strlen (cmd) - i + 1);
strcat (command, s); strcat (command, s);
g_free (s); g_free (s);
@ -228,8 +229,6 @@ enter (WInput *cmdline)
} }
command[j] = 0; command[j] = 0;
} }
old_dlg = current_dlg;
current_dlg = 0;
new_input (cmdline); new_input (cmdline);
shell_execute (command, 0); shell_execute (command, 0);
g_free (command); g_free (command);
@ -242,9 +241,6 @@ enter (WInput *cmdline)
if (use_subshell) if (use_subshell)
load_prompt (0, 0); load_prompt (0, 0);
#endif #endif
current_dlg = old_dlg;
}
} }
return MSG_HANDLED; return MSG_HANDLED;
} }