* cmd.c (mkdir_cmd): Fixed a memory leak. Instead of the

absolute path of the created directory, the input is passed to
	update_panels().
This commit is contained in:
Roland Illig 2006-02-04 11:12:28 +00:00
parent f84cc04e70
commit 350c958f5e
2 changed files with 14 additions and 13 deletions

View File

@ -1,6 +1,9 @@
2006-02-04 Roland Illig <roland.illig@gmx.de>
* find.c: Added make_fullname() to avoid code duplication.
* cmd.c (mkdir_cmd): Fixed a memory leak. Instead of the
absolute path of the created directory, the input is passed to
update_panels().
2006-02-03 Roland Illig <roland.illig@gmx.de>

View File

@ -346,32 +346,30 @@ void ren_cmd_local (void)
void
mkdir_cmd (void)
{
char *tempdir;
char *dir;
char *dir, *absdir;
dir =
input_expand_dialog (_("Create a new Directory"),
_(" Enter directory name:"), "");
if (!dir || !*dir)
if (!dir)
return;
if (dir[0] == '/' || dir[0] == '~')
tempdir = g_strdup (dir);
absdir = g_strdup (dir);
else
tempdir = concat_dir_and_file (current_panel->cwd, dir);
g_free (dir);
absdir = concat_dir_and_file (current_panel->cwd, dir);
save_cwds_stat ();
if (my_mkdir (tempdir, 0777) == 0) {
update_panels (UP_OPTIMIZE, tempdir);
if (my_mkdir (absdir, 0777) == 0) {
update_panels (UP_OPTIMIZE, dir);
repaint_screen ();
select_item (current_panel);
g_free (tempdir);
return;
} else {
message (1, MSG_ERROR, " %s ", unix_error_string (errno));
}
g_free (tempdir);
message (1, MSG_ERROR, " %s ", unix_error_string (errno));
g_free (absdir);
g_free (dir);
}
void delete_cmd (void)