summaryrefslogtreecommitdiff
path: root/editors/nano/files/patch-search.c
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@FreeBSD.org>2003-10-06 13:36:39 +0000
committerChristian Weisgerber <naddy@FreeBSD.org>2003-10-06 13:36:39 +0000
commit0a34781d2974d9df5c7fd48de1cd527fb08c4aed (patch)
tree7ef1bdcac654f19ecb83af324c0ac8481c7bb1e3 /editors/nano/files/patch-search.c
parent Update runtime to latest versions. (diff)
Fix fatal memory allocation bug.
Notes
Notes: svn path=/head/; revision=90449
Diffstat (limited to 'editors/nano/files/patch-search.c')
-rw-r--r--editors/nano/files/patch-search.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/editors/nano/files/patch-search.c b/editors/nano/files/patch-search.c
new file mode 100644
index 000000000000..b2472c023d5e
--- /dev/null
+++ b/editors/nano/files/patch-search.c
@@ -0,0 +1,19 @@
+
+$FreeBSD$
+
+--- search.c.orig Sun Oct 5 02:38:32 2003
++++ search.c Sun Oct 5 02:40:32 2003
+@@ -769,8 +769,12 @@
+
+ int do_gotoline(int line, int save_pos)
+ {
++ static char *linestr = NULL;
++
++ linestr = mallocstrcpy(linestr, answer);
++
+ if (line <= 0) { /* Ask for it */
+- int st = statusq(FALSE, goto_list, line != 0 ? answer : "",
++ int st = statusq(FALSE, goto_list, line != 0 ? linestr : "",
+ #ifndef NANO_SMALL
+ NULL,
+ #endif