Skip to content

Commit

Permalink
leafpad: fix bug causing junk written on saving
Browse files Browse the repository at this point in the history
the string str was converted into UTF8 and stored into a new string
cstr, and then freed. however when saving str was used again instead
of cstr.

fixes #129
  • Loading branch information
rofl0r committed Oct 19, 2013
1 parent 5549df4 commit f6d6534
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
11 changes: 11 additions & 0 deletions KEEP/leafpad-savebug.patch
@@ -0,0 +1,11 @@
--- leafpad-0.8.18.org/src/file.c 2013-10-19 23:33:43.767308069 +0000
+++ leafpad-0.8.18/src/file.c 2013-10-19 23:34:34.263306257 +0000
@@ -223,7 +223,7 @@
GTK_MESSAGE_ERROR, _("Can't open file to write"));
return -1;
}
- if (fwrite(str, 1, wbytes, fp) != wbytes) {
+ if (fwrite(cstr, 1, wbytes, fp) != wbytes) {
run_dialog_message(gtk_widget_get_toplevel(view),
GTK_MESSAGE_ERROR, _("Can't write file"));
return -1;
7 changes: 5 additions & 2 deletions pkg/leafpad
Expand Up @@ -9,8 +9,11 @@ sha512=315f5541dfe8d519ea832ad8b13b034a5ac173f8b9c0de7e3f774780b4ef42f2fab29e3ef
gtk+2

[build]
#patch -p1 < "$K/some.patch"
CFLAGS=-D_GNU_SOURCE ./configure -C --prefix="$butch_prefix" \
patch -p1 < "$K/"leafpad-savebug.patch || exit 1

CFLAGS="-D_GNU_SOURCE $optcflags" \
LDFLAGS="$optldflags" \
./configure -C --prefix="$butch_prefix" \
--disable-nls || exit 1

for i in po ; do
Expand Down

0 comments on commit f6d6534

Please sign in to comment.