* editcmd.c (edit_split_filename): Rename to edit_set_filename,
use g_malloc() and g_free() on edit->filename.
Этот коммит содержится в:
родитель
90821fb2b8
Коммит
ca658f44a6
@ -1,3 +1,8 @@
|
||||
2002-12-14 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* editcmd.c (edit_split_filename): Rename to edit_set_filename,
|
||||
use g_malloc() and g_free() on edit->filename.
|
||||
|
||||
2002-12-08 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* edit.c (edit_open_file): Remove "text" and "text_size"
|
||||
|
@ -521,11 +521,7 @@ edit_init (WEdit *edit, int lines, int columns, const char *filename,
|
||||
}
|
||||
}
|
||||
edit->force |= REDRAW_PAGE;
|
||||
if (filename) {
|
||||
edit_split_filename (edit, filename);
|
||||
} else {
|
||||
edit->filename = (char *) strdup ("");
|
||||
}
|
||||
edit_set_filename (edit, filename);
|
||||
edit->stack_size = START_STACK_SIZE;
|
||||
edit->stack_size_mask = START_STACK_SIZE - 1;
|
||||
edit->undo_stack = malloc ((edit->stack_size + 10) * sizeof (long));
|
||||
@ -586,8 +582,7 @@ edit_clean (WEdit *edit)
|
||||
|
||||
if (edit->undo_stack)
|
||||
free (edit->undo_stack);
|
||||
if (edit->filename)
|
||||
free (edit->filename);
|
||||
g_free (edit->filename);
|
||||
|
||||
edit_purge_widget (edit);
|
||||
|
||||
|
@ -235,7 +235,7 @@ void edit_paste_from_X_buf_cmd (WEdit * edit);
|
||||
|
||||
void edit_paste_from_history (WEdit *edit);
|
||||
|
||||
void edit_split_filename (WEdit * edit, const char *name);
|
||||
void edit_set_filename (WEdit *edit, const char *name);
|
||||
|
||||
void edit_load_syntax (WEdit * edit, char **names, char *type);
|
||||
void edit_free_syntax_rules (WEdit * edit);
|
||||
|
@ -398,11 +398,14 @@ void menu_save_mode_cmd (void)
|
||||
memcpy ((char *) &option_backup_ext_int, str_result, strlen (option_backup_ext));
|
||||
}
|
||||
|
||||
void edit_split_filename (WEdit * edit, const char *f)
|
||||
void
|
||||
edit_set_filename (WEdit *edit, const char *f)
|
||||
{
|
||||
if (edit->filename)
|
||||
free (edit->filename);
|
||||
edit->filename = (char *) strdup (f);
|
||||
g_free (edit->filename);
|
||||
if (!f)
|
||||
f = "";
|
||||
edit->filename = (char *) g_strdup (f);
|
||||
}
|
||||
|
||||
/* Here we want to warn the users of overwriting an existing file,
|
||||
@ -442,7 +445,7 @@ edit_save_as_cmd (WEdit *edit)
|
||||
}
|
||||
}
|
||||
if (edit_save_file (edit, exp)) {
|
||||
edit_split_filename (edit, exp);
|
||||
edit_set_filename (edit, exp);
|
||||
g_free (exp);
|
||||
edit->modified = 0;
|
||||
edit->delete_file = 0;
|
||||
@ -735,7 +738,7 @@ edit_load_file_from_filename (WEdit * edit, char *exp)
|
||||
{
|
||||
if (!edit_reload (edit, exp))
|
||||
return 1;
|
||||
edit_split_filename (edit, exp);
|
||||
edit_set_filename (edit, exp);
|
||||
edit->modified = 0;
|
||||
return 0;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user