mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
Ticket #2759: Unable to edit gzipped files
Steps to reprosuce: *) dmesg| gzip -c9 > out.gz *) press F4 on out.gz file Expected result: editor should be opened Actual result: segmentation fault. Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
9d72cf5aa6
commit
d52b1dced1
@ -2121,7 +2121,6 @@ edit_insert_file (WEdit * edit, const vfs_path_t * filename_vpath)
|
||||
edit_error_dialog (_("Error"), errmsg);
|
||||
g_free (errmsg);
|
||||
ins_len = -1;
|
||||
goto ret;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2132,7 +2131,6 @@ edit_insert_file (WEdit * edit, const vfs_path_t * filename_vpath)
|
||||
edit_error_dialog (_("Error"), errmsg);
|
||||
g_free (errmsg);
|
||||
ins_len = -1;
|
||||
goto ret;
|
||||
}
|
||||
g_free (p);
|
||||
}
|
||||
@ -2145,10 +2143,7 @@ edit_insert_file (WEdit * edit, const vfs_path_t * filename_vpath)
|
||||
|
||||
file = mc_open (filename_vpath, O_RDONLY | O_BINARY);
|
||||
if (file == -1)
|
||||
{
|
||||
ins_len = -1;
|
||||
goto ret;
|
||||
}
|
||||
return -1;
|
||||
|
||||
buf = g_malloc0 (TEMP_BUF_LEN);
|
||||
blocklen = mc_read (file, buf, sizeof (VERTICAL_MAGIC));
|
||||
@ -2202,8 +2197,6 @@ edit_insert_file (WEdit * edit, const vfs_path_t * filename_vpath)
|
||||
ins_len = 0;
|
||||
}
|
||||
|
||||
ret:
|
||||
g_free (p);
|
||||
return ins_len;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user