Leafpad has a bug/undefined behavior saving files opened via GVFS (and maybe else situations). It truncates them (resulting file size is a 4096 bytes multiplicator as I understand). So *data corruption is happened*. There are different opinions if this is a Leafpad's issue or GVFS or else. But changing this to lines solves the problem [1]: diff --git a/src/file.c b/src/file.c index c4f50cf..08e0a1f 100644 --- a/src/file.c +++ b/src/file.c @@ -224,8 +224,8 @@ gint file_save_real(GtkWidget *view, FileInfo *fi) return -1; } - gtk_text_buffer_set_modified(buffer, FALSE); fclose(fp); + gtk_text_buffer_set_modified(buffer, FALSE); g_free(cstr); return 0; I think it's a Leafpad issue [2]. The author didn't reply on my message. There is no reply in GVFS conversation. -- [1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680418#29 [2]: https://github.com/stevenhoneyman/l3afpad/issues/13#issuecomment-393278934 [3]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680418 [4]: https://github.com/stevenhoneyman/l3afpad/issues/13 [5]: https://bugzilla.redhat.com/show_bug.cgi?id=1295007 [6]: https://bugs.launchpad.net/ubuntu/+source/leafpad/+bug/708829 [7]: https://bugs.archlinux.org/task/44681 [8]: https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/658069 [9]: https://bugs.launchpad.net/ubuntu/+source/eclipse/+bug/655434 [10]: http://forums.fedoraforum.org/showthread.php?t=249927
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a58c0bbe20e4e31e68f826fa0197deb7ea91f9a commit 2a58c0bbe20e4e31e68f826fa0197deb7ea91f9a Author: Pacho Ramos <pacho@gentoo.org> AuthorDate: 2018-10-20 16:45:59 +0000 Commit: Pacho Ramos <pacho@gentoo.org> CommitDate: 2018-10-20 16:53:18 +0000 app-editors/leafpad: Fix truncation bug (#657462 by Alexander Kurakin) Closes: https://bugs.gentoo.org/657462 Signed-off-by: Pacho Ramos <pacho@gentoo.org> Package-Manager: Portage-2.3.51, Repoman-2.3.11 .../leafpad/files/leafpad-0.8.18.1-truncate.patch | 20 +++++++++ app-editors/leafpad/leafpad-0.8.18.1-r1.ebuild | 49 ++++++++++++++++++++++ 2 files changed, 69 insertions(+)
BTW, I think we have to mask all previous versions (better late than never :)).