1 |
vapier 08/10/19 06:56:40 |
2 |
|
3 |
Added: nano-2.1.6-cut-last.patch |
4 |
Log: |
5 |
Add fix from upstream for cutting at end of file #240330 by amadeus.bit. |
6 |
(Portage version: 2.2_rc12/cvs/Linux 2.6.26.2 x86_64) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 app-editors/nano/files/nano-2.1.6-cut-last.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/nano/files/nano-2.1.6-cut-last.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/nano/files/nano-2.1.6-cut-last.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: nano-2.1.6-cut-last.patch |
15 |
=================================================================== |
16 |
http://bugs.gentoo.org/240330 |
17 |
|
18 |
From a203163ac137a7b184e7e7a03ab7254e502d0775 Mon Sep 17 00:00:00 2001 |
19 |
From: astyanax <astyanax@35c25a1d-7b9e-4130-9fde-d3aeb78583b8> |
20 |
Date: Tue, 14 Oct 2008 01:14:12 +0000 |
21 |
Subject: [PATCH] 2008-10-13 Chris Allegretta <chrisa@××××.org> |
22 |
* Remove CUTTOEND as an undo type as it's unneeded, fix u->to_end logic in undo struct. |
23 |
* undo.c (update_undo): Don't free cutbuffer if NULL, fix for Savannah bug #24499 |
24 |
|
25 |
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4339 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 |
26 |
--- |
27 |
ChangeLog | 4 ++++ |
28 |
src/cut.c | 2 +- |
29 |
src/nano.h | 2 +- |
30 |
src/text.c | 12 +++++------- |
31 |
4 files changed, 11 insertions(+), 9 deletions(-) |
32 |
|
33 |
diff --git a/ChangeLog b/ChangeLog |
34 |
index 5f0f132..c14b724 100644 |
35 |
--- a/ChangeLog |
36 |
+++ b/ChangeLog |
37 |
@@ -1,3 +1,7 @@ |
38 |
+2008-10-13 Chris Allegretta <chrisa@××××.org> |
39 |
+ * Remove CUTTOEND as an undo type as it's unneeded, fix u->to_end logic in undo struct. |
40 |
+ * undo.c (update_undo): Don't free cutbuffer if NULL, fix for Savannah bug #24499 |
41 |
+ |
42 |
2008-10-04 Chris Allegretta <chrisa@××××.org> |
43 |
* cut.c (Add_undo): Save last cut undo information so it can be used for next uncut, fixes |
44 |
Savannah bug 24183. |
45 |
diff --git a/src/cut.c b/src/cut.c |
46 |
index 2689986..f92f9b3 100644 |
47 |
--- a/src/cut.c |
48 |
+++ b/src/cut.c |
49 |
@@ -245,7 +245,7 @@ void do_copy_text(void) |
50 |
void do_cut_till_end(void) |
51 |
{ |
52 |
#ifndef NANO_TINY |
53 |
- add_undo(CUTTOEND); |
54 |
+ add_undo(CUT); |
55 |
#endif |
56 |
do_cut_text(FALSE, TRUE, FALSE); |
57 |
} |
58 |
diff --git a/src/nano.h b/src/nano.h |
59 |
index c82122d..3bc10f1 100644 |
60 |
--- a/src/nano.h |
61 |
+++ b/src/nano.h |
62 |
@@ -170,7 +170,7 @@ typedef enum { |
63 |
} function_type; |
64 |
|
65 |
typedef enum { |
66 |
- ADD, DEL, REPLACE, SPLIT, UNSPLIT, CUT, CUTTOEND, UNCUT, INSERT, OTHER |
67 |
+ ADD, DEL, REPLACE, SPLIT, UNSPLIT, CUT, UNCUT, INSERT, OTHER |
68 |
} undo_type; |
69 |
|
70 |
/* Structure types. */ |
71 |
diff --git a/src/text.c b/src/text.c |
72 |
index 97e1f19..915d1c1 100644 |
73 |
--- a/src/text.c |
74 |
+++ b/src/text.c |
75 |
@@ -408,7 +408,7 @@ void redo_cut(undo *u) { |
76 |
#ifdef DEBUG |
77 |
fprintf(stderr, "Undoing multi-^K cut, u->linescut = %d\n", u->linescut); |
78 |
#endif |
79 |
- for (i = 0, t = openfile->current; i < u->linescut; i++) { |
80 |
+ for (i = 0, t = openfile->current; i < u->linescut && t->next != NULL ; i++) { |
81 |
|
82 |
#ifdef DEBUG |
83 |
fprintf(stderr, "Advancing, lineno = %d, data = \"%s\"\n", t->lineno, t->data); |
84 |
@@ -505,7 +505,6 @@ void do_undo(void) |
85 |
renumber(f); |
86 |
break; |
87 |
case CUT: |
88 |
- case CUTTOEND: |
89 |
undidmsg = _("text cut"); |
90 |
undo_cut(u); |
91 |
break; |
92 |
@@ -629,7 +628,6 @@ void do_redo(void) |
93 |
renumber(f); |
94 |
break; |
95 |
case CUT: |
96 |
- case CUTTOEND: |
97 |
undidmsg = _("text cut"); |
98 |
redo_cut(u); |
99 |
break; |
100 |
@@ -890,13 +888,12 @@ void add_undo(undo_type current_action) |
101 |
u->strdata = data; |
102 |
break; |
103 |
case CUT: |
104 |
- case CUTTOEND: |
105 |
u->mark_set = openfile->mark_set; |
106 |
if (u->mark_set) { |
107 |
u->mark_begin_lineno = openfile->mark_begin->lineno; |
108 |
u->mark_begin_x = openfile->mark_begin_x; |
109 |
} |
110 |
- u->to_end = (current_action == CUTTOEND); |
111 |
+ u->to_end = (ISSET(CUT_TO_END)) ? TRUE : FALSE; |
112 |
last_cutu = u; |
113 |
break; |
114 |
case UNCUT: |
115 |
@@ -951,7 +948,7 @@ void update_undo(undo_type action) |
116 |
/* Change to an add if we're not using the same undo struct |
117 |
that we should be using */ |
118 |
if (action != fs->last_action |
119 |
- || (action != CUT && action != CUTTOEND && action != INSERT |
120 |
+ || (action != CUT && action != INSERT |
121 |
&& openfile->current->lineno != fs->current_undo->lineno)) { |
122 |
add_undo(action); |
123 |
return; |
124 |
@@ -1016,7 +1013,8 @@ void update_undo(undo_type action) |
125 |
#endif |
126 |
break; |
127 |
case CUT: |
128 |
- case CUTTOEND: |
129 |
+ if (!cutbuffer) |
130 |
+ break; |
131 |
if (u->cutbuffer) |
132 |
free(u->cutbuffer); |
133 |
u->cutbuffer = copy_filestruct(cutbuffer); |
134 |
-- |
135 |
1.6.0.1 |