mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-18 17:29:28 +03:00
* edit.c (edit_clean): g_free handles NULL argument too,
no need for the comparison. (edit_move_backward_lots): Likewise. * editcmd.c (edit_set_filename): Likewise. (edit_replace_cmd): Likewise. (edit_search_cmd): Likewise. (edit_sort_cmd): Likewise. (edit_mail_dialog): Likewise. * syntax.c (syntax_g_free): Likewise. (edit_read_syntax_rules): Likewise.
This commit is contained in:
parent
68a7c1dfab
commit
12d24222db
@ -1,3 +1,16 @@
|
||||
2004-09-25 Pavel S. Shirshov <pavelsh@mail.ru>
|
||||
|
||||
* edit.c (edit_clean): g_free handles NULL argument too,
|
||||
no need for the comparison.
|
||||
(edit_move_backward_lots): Likewise.
|
||||
* editcmd.c (edit_set_filename): Likewise.
|
||||
(edit_replace_cmd): Likewise.
|
||||
(edit_search_cmd): Likewise.
|
||||
(edit_sort_cmd): Likewise.
|
||||
(edit_mail_dialog): Likewise.
|
||||
* syntax.c (syntax_g_free): Likewise.
|
||||
(edit_read_syntax_rules): Likewise.
|
||||
|
||||
2004-09-24 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
* editdraw.c (status_string): Removed unused parameter.
|
||||
|
@ -593,10 +593,8 @@ edit_clean (WEdit *edit)
|
||||
edit_free_syntax_rules (edit);
|
||||
book_mark_flush (edit, -1);
|
||||
for (; j <= MAXBUFF; j++) {
|
||||
if (edit->buffers1[j] != NULL)
|
||||
g_free (edit->buffers1[j]);
|
||||
if (edit->buffers2[j] != NULL)
|
||||
g_free (edit->buffers2[j]);
|
||||
g_free (edit->buffers1[j]);
|
||||
g_free (edit->buffers2[j]);
|
||||
}
|
||||
|
||||
g_free (edit->undo_stack);
|
||||
@ -1053,8 +1051,7 @@ edit_move_backward_lots (WEdit *edit, long increment)
|
||||
edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] =
|
||||
g_malloc (EDIT_BUF_SIZE);
|
||||
} else {
|
||||
if (p)
|
||||
g_free (p);
|
||||
g_free (p);
|
||||
}
|
||||
|
||||
s = edit->curs1 & M_EDIT_BUF_SIZE;
|
||||
|
@ -440,8 +440,7 @@ void menu_save_mode_cmd (void)
|
||||
void
|
||||
edit_set_filename (WEdit *edit, const char *f)
|
||||
{
|
||||
if (edit->filename)
|
||||
g_free (edit->filename);
|
||||
g_free (edit->filename);
|
||||
if (!f)
|
||||
f = "";
|
||||
edit->filename = g_strdup (f);
|
||||
@ -1759,18 +1758,12 @@ edit_replace_cmd (WEdit *edit, int again)
|
||||
int argord[NUM_REPL_ARGS];
|
||||
|
||||
if (!edit) {
|
||||
if (old1) {
|
||||
g_free (old1);
|
||||
old1 = 0;
|
||||
}
|
||||
if (old2) {
|
||||
g_free (old2);
|
||||
old2 = 0;
|
||||
}
|
||||
if (old3) {
|
||||
g_free (old3);
|
||||
old3 = 0;
|
||||
}
|
||||
g_free (old1);
|
||||
old1 = 0;
|
||||
g_free (old2);
|
||||
old2 = 0;
|
||||
g_free (old3);
|
||||
old3 = 0;
|
||||
return;
|
||||
}
|
||||
last_search = edit->last_byte;
|
||||
@ -2008,10 +2001,8 @@ void edit_search_cmd (WEdit * edit, int again)
|
||||
char *exp = "";
|
||||
|
||||
if (!edit) {
|
||||
if (old) {
|
||||
g_free (old);
|
||||
old = 0;
|
||||
}
|
||||
g_free (old);
|
||||
old = 0;
|
||||
return;
|
||||
}
|
||||
exp = old ? old : exp;
|
||||
@ -2039,8 +2030,7 @@ void edit_search_cmd (WEdit * edit, int again)
|
||||
if (exp) {
|
||||
if (*exp) {
|
||||
int len = 0;
|
||||
if (old)
|
||||
g_free (old);
|
||||
g_free (old);
|
||||
old = g_strdup (exp);
|
||||
|
||||
if (search_create_bookmark) {
|
||||
@ -2378,8 +2368,7 @@ int edit_sort_cmd (WEdit * edit)
|
||||
|
||||
if (!exp)
|
||||
return 1;
|
||||
if (old)
|
||||
g_free (old);
|
||||
g_free (old);
|
||||
old = exp;
|
||||
|
||||
e = system (catstrs (" sort ", exp, " ", home_dir, BLOCK_FILE, " > ", home_dir, TEMP_FILE, (char *) NULL));
|
||||
@ -2624,12 +2613,9 @@ void edit_mail_dialog (WEdit * edit)
|
||||
Quick_input.widgets = quick_widgets;
|
||||
|
||||
if (quick_dialog (&Quick_input) != B_CANCEL) {
|
||||
if (mail_cc_last)
|
||||
g_free (mail_cc_last);
|
||||
if (mail_subject_last)
|
||||
g_free (mail_subject_last);
|
||||
if (mail_to_last)
|
||||
g_free (mail_to_last);
|
||||
g_free (mail_cc_last);
|
||||
g_free (mail_subject_last);
|
||||
g_free (mail_to_last);
|
||||
mail_cc_last = tmail_cc;
|
||||
mail_subject_last = tmail_subject;
|
||||
mail_to_last = tmail_to;
|
||||
|
@ -86,7 +86,7 @@ struct _syntax_marker {
|
||||
|
||||
int option_syntax_highlighting = 1;
|
||||
|
||||
#define syntax_g_free(x) do {if(x) {g_free(x); (x)=0;}} while (0)
|
||||
#define syntax_g_free(x) do {g_free(x); (x)=0;} while (0)
|
||||
|
||||
static gint
|
||||
mc_defines_destroy (gpointer key, gpointer value, gpointer data)
|
||||
@ -673,8 +673,7 @@ edit_read_syntax_rules (WEdit *edit, FILE *f, char **args)
|
||||
g = 0;
|
||||
line = save_line + 1;
|
||||
syntax_g_free (error_file_name);
|
||||
if (l)
|
||||
syntax_g_free (l);
|
||||
syntax_g_free (l);
|
||||
if (!read_one_line (&l, f))
|
||||
break;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user