mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-09 13:02:01 +03:00
* hotlist.c (add_new_entry_cmd): Fix memory leaks.
This commit is contained in:
parent
c8cd60f3a2
commit
959955939d
@ -1,3 +1,7 @@
|
|||||||
|
2004-10-17 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||||
|
|
||||||
|
* hotlist.c (add_new_entry_cmd): Fix memory leaks.
|
||||||
|
|
||||||
2004-10-16 Roland Illig <roland.illig@gmx.de>
|
2004-10-16 Roland Illig <roland.illig@gmx.de>
|
||||||
|
|
||||||
* file.c (do_file_error): Add const qualifier. (query_recursive):
|
* file.c (do_file_error): Add const qualifier. (query_recursive):
|
||||||
|
@ -822,7 +822,7 @@ static void add_widgets_i18n(QuickWidget* qw, int len)
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
add_new_entry_input (const char *header, const char *text1, const char *text2,
|
add_new_entry_input (const char *header, const char *text1, const char *text2,
|
||||||
const char *help, char **r1, char **r2)
|
const char *help, char **r1, char **r2)
|
||||||
{
|
{
|
||||||
#define RELATIVE_Y_BUTTONS 4
|
#define RELATIVE_Y_BUTTONS 4
|
||||||
#define RELATIVE_Y_LABEL_PTH 3
|
#define RELATIVE_Y_LABEL_PTH 3
|
||||||
@ -892,8 +892,8 @@ add_new_entry_input (const char *header, const char *text1, const char *text2,
|
|||||||
|
|
||||||
Quick_input.widgets = quick_widgets;
|
Quick_input.widgets = quick_widgets;
|
||||||
if ((i = quick_dialog (&Quick_input)) != B_CANCEL){
|
if ((i = quick_dialog (&Quick_input)) != B_CANCEL){
|
||||||
*r1 = *(quick_widgets [5].str_result);
|
*r1 = my_str1;
|
||||||
*r2 = *(quick_widgets [3].str_result);
|
*r2 = my_str2;
|
||||||
return i;
|
return i;
|
||||||
} else
|
} else
|
||||||
return 0;
|
return 0;
|
||||||
@ -901,22 +901,22 @@ add_new_entry_input (const char *header, const char *text1, const char *text2,
|
|||||||
|
|
||||||
static void add_new_entry_cmd (void)
|
static void add_new_entry_cmd (void)
|
||||||
{
|
{
|
||||||
char *title = 0, *url = 0;
|
char *title, *url;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Take current directory as default value for input fields */
|
/* Take current directory as default value for input fields */
|
||||||
title = url = current_panel->cwd;
|
title = url = current_panel->cwd;
|
||||||
|
|
||||||
ret = add_new_entry_input (_("New hotlist entry"), _("Directory label"), _("Directory path"),
|
ret = add_new_entry_input (_("New hotlist entry"), _("Directory label"),
|
||||||
"[Hotlist]", &title, &url);
|
_("Directory path"), "[Hotlist]", &title, &url);
|
||||||
|
|
||||||
if (!ret || !title || !*title || !url || !*url)
|
if (!ret || !title || !*title || !url || !*url)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ret == B_ENTER || ret == B_APPEND)
|
if (ret == B_ENTER || ret == B_APPEND)
|
||||||
add2hotlist (g_strdup (title),g_strdup (url), HL_TYPE_ENTRY, 2);
|
add2hotlist (title, url, HL_TYPE_ENTRY, 2);
|
||||||
else
|
else
|
||||||
add2hotlist (g_strdup (title),g_strdup (url), HL_TYPE_ENTRY, 1);
|
add2hotlist (title, url, HL_TYPE_ENTRY, 1);
|
||||||
|
|
||||||
hotlist_state.modified = 1;
|
hotlist_state.modified = 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user