From 74ed317f35775cc4975c30f5808a01c8af52fa33 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Thu, 11 Apr 2013 10:34:40 +0400 Subject: [PATCH] Cleanup: remove unused 'prompt_pos' variable. (do_subshell_chdir): remove 'reset_prompt' argument because of removed 'prompt_pos'. Signed-off-by: Andrew Borodin --- src/filemanager/panel.c | 4 ++-- src/subshell.c | 14 +++----------- src/subshell.h | 2 +- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c index 8ee076e6a..18555b72c 100644 --- a/src/filemanager/panel.c +++ b/src/filemanager/panel.c @@ -2,7 +2,7 @@ Panel managing. Copyright (C) 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2009, 2011, 2013 + 2005, 2006, 2007, 2009, 2011, 2012, 2013 The Free Software Foundation, Inc. Written by: @@ -3017,7 +3017,7 @@ subshell_chdir (const vfs_path_t * vpath) { #ifdef ENABLE_SUBSHELL if (mc_global.tty.use_subshell && vfs_current_is_local ()) - do_subshell_chdir (vpath, FALSE, TRUE); + do_subshell_chdir (vpath, FALSE); #else /* ENABLE_SUBSHELL */ (void) vpath; #endif /* ENABLE_SUBSHELL */ diff --git a/src/subshell.c b/src/subshell.c index dfbc6bb55..db1bbec85 100644 --- a/src/subshell.c +++ b/src/subshell.c @@ -174,11 +174,7 @@ static struct termios shell_mode; /* are delivered to the shell pty */ static struct termios raw_mode; -/* This counter indicates how many characters of prompt we have read */ -/* FIXME: try to figure out why this had to become global */ -static int prompt_pos; - - +/* --------------------------------------------------------------------------------------------- */ /*** file scope functions ************************************************************************/ /* --------------------------------------------------------------------------------------------- */ /** @@ -935,7 +931,7 @@ invoke_subshell (const char *command, int how, vfs_path_t ** new_dir_vpath) /* Make the subshell change to MC's working directory */ if (new_dir_vpath != NULL) - do_subshell_chdir (current_panel->cwd_vpath, TRUE, TRUE); + do_subshell_chdir (current_panel->cwd_vpath, TRUE); if (command == NULL) /* The user has done "C-o" from MC */ { @@ -971,8 +967,6 @@ invoke_subshell (const char *command, int how, vfs_path_t ** new_dir_vpath) while (!subshell_alive && quit == 0 && mc_global.tty.use_subshell) init_subshell (); - prompt_pos = 0; - return quit; } @@ -1157,7 +1151,7 @@ subshell_name_quote (const char *s) /** If it actually changed the directory it returns true */ void -do_subshell_chdir (const vfs_path_t * vpath, gboolean update_prompt, gboolean reset_prompt) +do_subshell_chdir (const vfs_path_t * vpath, gboolean update_prompt) { char *pcwd; @@ -1237,8 +1231,6 @@ do_subshell_chdir (const vfs_path_t * vpath, gboolean update_prompt, gboolean re } } - if (reset_prompt) - prompt_pos = 0; update_subshell_prompt = FALSE; g_free (pcwd); diff --git a/src/subshell.h b/src/subshell.h index 82cc2fe35..e0fdfb13e 100644 --- a/src/subshell.h +++ b/src/subshell.h @@ -43,7 +43,7 @@ int invoke_subshell (const char *command, int how, vfs_path_t ** new_dir); gboolean read_subshell_prompt (void); void do_update_prompt (void); gboolean exit_subshell (void); -void do_subshell_chdir (const vfs_path_t * vpath, gboolean update_prompt, gboolean reset_prompt); +void do_subshell_chdir (const vfs_path_t * vpath, gboolean update_prompt); void subshell_get_console_attributes (void); void sigchld_handler (int sig);