* main.c (directory_history_add): Don't change the directory

passed as the argument, work on a copy.
This commit is contained in:
Pavel Roskin 2003-05-05 15:30:43 +00:00
parent 0a6c496e40
commit 12f4a6665a
3 changed files with 11 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2003-05-05 Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
* main.c (directory_history_add): Don't change the directory
passed as the argument, work on a copy.
2003-04-16 Andrew V. Samoilov <sav@bcs.zp.ua>
* find.c (get_line_at): Strip trailing newline to fix $

View File

@ -687,14 +687,14 @@ subshell_chdir (char *directory)
}
void
directory_history_add (struct WPanel *panel, char *s)
directory_history_add (struct WPanel *panel, const char *dir)
{
char *text;
char *tmp;
text = g_strdup (s);
strip_password (s, 1);
tmp = g_strdup (dir);
strip_password (tmp, 1);
panel->dir_history = list_append_unique (panel->dir_history, text);
panel->dir_history = list_append_unique (panel->dir_history, tmp);
}
/*

View File

@ -168,7 +168,7 @@ void init_menu (void);
#endif /* !NATIVE_WIN32 */
struct WPanel;
void directory_history_add (struct WPanel *panel, char *s);
void directory_history_add (struct WPanel *panel, const char *dir);
int do_panel_cd (struct WPanel *panel, char *new_dir, enum cd_enum cd_type);
#endif /* !__MAIN_H */