mirror of
https://github.com/MidnightCommander/mc
synced 2025-03-11 18:32:53 +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);
|
edit_error_dialog (_("Error"), errmsg);
|
||||||
g_free (errmsg);
|
g_free (errmsg);
|
||||||
ins_len = -1;
|
ins_len = -1;
|
||||||
goto ret;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2132,7 +2131,6 @@ edit_insert_file (WEdit * edit, const vfs_path_t * filename_vpath)
|
|||||||
edit_error_dialog (_("Error"), errmsg);
|
edit_error_dialog (_("Error"), errmsg);
|
||||||
g_free (errmsg);
|
g_free (errmsg);
|
||||||
ins_len = -1;
|
ins_len = -1;
|
||||||
goto ret;
|
|
||||||
}
|
}
|
||||||
g_free (p);
|
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);
|
file = mc_open (filename_vpath, O_RDONLY | O_BINARY);
|
||||||
if (file == -1)
|
if (file == -1)
|
||||||
{
|
return -1;
|
||||||
ins_len = -1;
|
|
||||||
goto ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
buf = g_malloc0 (TEMP_BUF_LEN);
|
buf = g_malloc0 (TEMP_BUF_LEN);
|
||||||
blocklen = mc_read (file, buf, sizeof (VERTICAL_MAGIC));
|
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;
|
ins_len = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret:
|
|
||||||
g_free (p);
|
|
||||||
return ins_len;
|
return ins_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user