mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 11:40:06 +02:00
nano: bump version.
This commit is contained in:
@@ -13,8 +13,8 @@ HOMEPAGE="http://www.nano-editor.org/"
|
||||
COPYRIGHT="1999-2016 Free Software Foundation, Inc."
|
||||
LICENSE="GNU GPL v3"
|
||||
REVISION="1"
|
||||
SOURCE_URI="http://www.nano-editor.org/dist/v2.5/nano-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="b2b060129b9feff2d4870d803a441178c96531de9aed144ec0b83bd63ccb12ee"
|
||||
SOURCE_URI="http://www.nano-editor.org/dist/v2.7/nano-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="89cc45dd630c6fb7276a14e1b3436a9972cf6d66eed15b14c3583af99070353c"
|
||||
PATCHES="nano-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="x86_gcc2 x86 x86_64"
|
||||
@@ -1,144 +0,0 @@
|
||||
From f80a591de9d191ac3d0d86e2a0cb641f8b7b8f7a Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Mon, 23 Mar 2015 17:20:54 +0000
|
||||
Subject: Haiku patch
|
||||
|
||||
|
||||
diff --git a/src/nano.c b/src/nano.c
|
||||
index 3e26ae5..b151fb2 100644
|
||||
--- a/src/nano.c
|
||||
+++ b/src/nano.c
|
||||
@@ -2558,6 +2558,7 @@ int main(int argc, char **argv)
|
||||
#endif
|
||||
|
||||
#if !defined(NANO_TINY) && defined(HAVE_KEY_DEFINED)
|
||||
+{
|
||||
const char *keyvalue;
|
||||
/* Ask ncurses for the key codes for Control+Left and Control+Right. */
|
||||
keyvalue = tigetstr("kLFT5");
|
||||
@@ -2566,6 +2567,7 @@ int main(int argc, char **argv)
|
||||
keyvalue = tigetstr("kRIT5");
|
||||
if (keyvalue != 0 && keyvalue != (char *)-1)
|
||||
controlright = key_defined(keyvalue);
|
||||
+}
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
diff --git a/src/text.c b/src/text.c
|
||||
index 5ed326d..9f3491c 100644
|
||||
--- a/src/text.c
|
||||
+++ b/src/text.c
|
||||
@@ -441,11 +441,12 @@ void undo_cut(undo *u)
|
||||
/* Redo a cut, or undo an uncut. */
|
||||
void redo_cut(undo *u)
|
||||
{
|
||||
+ filestruct *oldcutbuffer = cutbuffer, *oldcutbottom = cutbottom;
|
||||
+
|
||||
/* If we cut the magicline, we may as well not crash. :/ */
|
||||
if (!u->cutbuffer)
|
||||
return;
|
||||
|
||||
- filestruct *oldcutbuffer = cutbuffer, *oldcutbottom = cutbottom;
|
||||
cutbuffer = cutbottom = NULL;
|
||||
|
||||
goto_line_posx(u->lineno, u->begin);
|
||||
@@ -468,6 +469,7 @@ void redo_cut(undo *u)
|
||||
/* Undo the last thing(s) we did. */
|
||||
void do_undo(void)
|
||||
{
|
||||
+ filestruct *f;
|
||||
undo *u = openfile->current_undo;
|
||||
filestruct *t = NULL;
|
||||
char *data, *undidmsg = NULL;
|
||||
@@ -477,7 +479,7 @@ void do_undo(void)
|
||||
return;
|
||||
}
|
||||
|
||||
- filestruct *f = fsfromline(u->mark_begin_lineno);
|
||||
+ f = fsfromline(u->mark_begin_lineno);
|
||||
if (!f) {
|
||||
statusbar(_("Internal error: can't match line %d. "
|
||||
"Please save your work."), u->mark_begin_lineno);
|
||||
@@ -568,6 +570,7 @@ void do_undo(void)
|
||||
break;
|
||||
case INSERT:
|
||||
undidmsg = _("text insert");
|
||||
+ {
|
||||
filestruct *oldcutbuffer = cutbuffer, *oldcutbottom = cutbottom;
|
||||
cutbuffer = NULL;
|
||||
cutbottom = NULL;
|
||||
@@ -586,6 +589,7 @@ void do_undo(void)
|
||||
cutbuffer = oldcutbuffer;
|
||||
cutbottom = oldcutbottom;
|
||||
openfile->mark_set = FALSE;
|
||||
+ }
|
||||
break;
|
||||
case REPLACE:
|
||||
undidmsg = _("text replace");
|
||||
@@ -613,6 +617,8 @@ void do_undo(void)
|
||||
/* Redo the last thing(s) we undid. */
|
||||
void do_redo(void)
|
||||
{
|
||||
+ filestruct *shoveline;
|
||||
+ filestruct *f;
|
||||
char *data, *redidmsg = NULL;
|
||||
undo *u = openfile->undotop;
|
||||
|
||||
@@ -630,7 +636,7 @@ void do_redo(void)
|
||||
return;
|
||||
}
|
||||
|
||||
- filestruct *f = fsfromline(u->type == INSERT ? 1 : u->mark_begin_lineno);
|
||||
+ f = fsfromline(u->type == INSERT ? 1 : u->mark_begin_lineno);
|
||||
if (!f) {
|
||||
statusbar(_("Internal error: can't match line %d. "
|
||||
"Please save your work."), u->mark_begin_lineno);
|
||||
@@ -664,7 +670,7 @@ void do_redo(void)
|
||||
break;
|
||||
case ENTER:
|
||||
redidmsg = _("line break");
|
||||
- filestruct *shoveline = make_new_node(f);
|
||||
+ shoveline = make_new_node(f);
|
||||
shoveline->data = mallocstrcpy(NULL, u->strdata);
|
||||
data = mallocstrncpy(NULL, f->data, u->begin + 1);
|
||||
data[u->begin] = '\0';
|
||||
@@ -1117,6 +1123,7 @@ fprintf(stderr, " >> Updating... action = %d, openfile->last_action = %d, openf
|
||||
free_filestruct(u->cutbuffer);
|
||||
u->cutbuffer = copy_filestruct(cutbuffer);
|
||||
if (u->mark_set) {
|
||||
+ ssize_t line;
|
||||
/* If the "marking" operation was from right-->left or
|
||||
* bottom-->top, then swap the mark points. */
|
||||
if ((u->lineno == u->mark_begin_lineno && u->begin < u->mark_begin_x)
|
||||
@@ -1125,7 +1132,7 @@ fprintf(stderr, " >> Updating... action = %d, openfile->last_action = %d, openf
|
||||
u->begin = u->mark_begin_x;
|
||||
u->mark_begin_x = x_loc;
|
||||
|
||||
- ssize_t line = u->lineno;
|
||||
+ line = u->lineno;
|
||||
u->lineno = u->mark_begin_lineno;
|
||||
u->mark_begin_lineno = line;
|
||||
} else
|
||||
@@ -1206,6 +1213,8 @@ bool do_wrap(filestruct *line)
|
||||
/* The next line, minus indentation. */
|
||||
size_t next_line_len = 0;
|
||||
/* The length of next_line. */
|
||||
+ size_t old_x;
|
||||
+ filestruct * oldLine;
|
||||
|
||||
/* There are three steps. First, we decide where to wrap. Then, we
|
||||
* create the new wrap line. Finally, we clean up. */
|
||||
@@ -1253,8 +1262,8 @@ bool do_wrap(filestruct *line)
|
||||
add_undo(SPLIT_BEGIN);
|
||||
#endif
|
||||
|
||||
- size_t old_x = openfile->current_x;
|
||||
- filestruct * oldLine = openfile->current;
|
||||
+ old_x = openfile->current_x;
|
||||
+ oldLine = openfile->current;
|
||||
openfile->current = line;
|
||||
|
||||
/* Step 2, making the new wrap line. It will consist of indentation
|
||||
--
|
||||
2.7.0
|
||||
|
||||
141
app-editors/nano/patches/nano-2.7.2.patchset
Normal file
141
app-editors/nano/patches/nano-2.7.2.patchset
Normal file
@@ -0,0 +1,141 @@
|
||||
From 13c59736cddc2aadf3bf2675b0f39dbc4e2411c9 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Wed, 21 Dec 2016 22:21:56 +0000
|
||||
Subject: gcc2 patch
|
||||
|
||||
|
||||
diff --git a/src/files.c b/src/files.c
|
||||
index 8955e19..0939654 100644
|
||||
--- a/src/files.c
|
||||
+++ b/src/files.c
|
||||
@@ -2085,6 +2085,7 @@ bool write_file(const char *name, FILE *f_open, bool tmp,
|
||||
if (method == OVERWRITE && !tmp) {
|
||||
/* If we must set the filename, and it changed, adjust things. */
|
||||
if (!nonamechange && strcmp(openfile->filename, realname) != 0) {
|
||||
+ char *newname;
|
||||
#ifndef DISABLE_COLOR
|
||||
char *oldname = openfile->syntax ? openfile->syntax->name : "";
|
||||
filestruct *line = openfile->fileage;
|
||||
@@ -2096,7 +2097,7 @@ bool write_file(const char *name, FILE *f_open, bool tmp,
|
||||
color_update();
|
||||
color_init();
|
||||
|
||||
- char *newname = openfile->syntax ? openfile->syntax->name : "";
|
||||
+ newname = openfile->syntax ? openfile->syntax->name : "";
|
||||
|
||||
/* If the syntax changed, discard and recompute the multidata. */
|
||||
if (strcmp(oldname, newname) != 0) {
|
||||
diff --git a/src/rcfile.c b/src/rcfile.c
|
||||
index a9426d2..5353ae0 100644
|
||||
--- a/src/rcfile.c
|
||||
+++ b/src/rcfile.c
|
||||
@@ -871,6 +871,8 @@ void grab_and_store(const char *kind, char *ptr, regexlisttype **storage)
|
||||
/* Parse and store the name given after a linter/formatter command. */
|
||||
void pick_up_name(const char *kind, char *ptr, char **storage)
|
||||
{
|
||||
+ char* p;
|
||||
+ char* q;
|
||||
assert(ptr != NULL);
|
||||
|
||||
if (!opensyntax) {
|
||||
@@ -891,8 +893,8 @@ void pick_up_name(const char *kind, char *ptr, char **storage)
|
||||
*storage = NULL;
|
||||
else if (*ptr == '"') {
|
||||
*storage = mallocstrcpy(NULL, ++ptr);
|
||||
- char* q = *storage;
|
||||
- char* p = *storage;
|
||||
+ q = *storage;
|
||||
+ p = *storage;
|
||||
/* Snip out the backslashes of escaped characters. */
|
||||
while (*p != '"') {
|
||||
if (*p == '\0') {
|
||||
diff --git a/src/text.c b/src/text.c
|
||||
index c03f3d2..ad96970 100644
|
||||
--- a/src/text.c
|
||||
+++ b/src/text.c
|
||||
@@ -657,11 +657,13 @@ void undo_cut(undo *u)
|
||||
/* Redo a cut, or undo an uncut. */
|
||||
void redo_cut(undo *u)
|
||||
{
|
||||
+ filestruct *oldcutbuffer, *oldcutbottom;
|
||||
+
|
||||
/* If we cut the magicline, we may as well not crash. :/ */
|
||||
if (!u->cutbuffer)
|
||||
return;
|
||||
|
||||
- filestruct *oldcutbuffer = cutbuffer, *oldcutbottom = cutbottom;
|
||||
+ oldcutbuffer = cutbuffer; oldcutbottom = cutbottom;
|
||||
cutbuffer = cutbottom = NULL;
|
||||
|
||||
goto_line_posx(u->lineno, u->begin);
|
||||
@@ -683,6 +685,7 @@ void do_undo(void)
|
||||
undo *u = openfile->current_undo;
|
||||
filestruct *f, *t = NULL;
|
||||
char *data, *undidmsg = NULL;
|
||||
+ filestruct *oldcutbuffer, *oldcutbottom;
|
||||
|
||||
if (!u) {
|
||||
statusbar(_("Nothing in undo buffer!"));
|
||||
@@ -789,7 +792,7 @@ void do_undo(void)
|
||||
#endif
|
||||
case INSERT:
|
||||
undidmsg = _("text insert");
|
||||
- filestruct *oldcutbuffer = cutbuffer, *oldcutbottom = cutbottom;
|
||||
+ oldcutbuffer = cutbuffer; oldcutbottom = cutbottom;
|
||||
cutbuffer = NULL;
|
||||
cutbottom = NULL;
|
||||
/* Instead of a line number, u->mark_begin_lineno contains the number
|
||||
@@ -835,7 +838,7 @@ void do_undo(void)
|
||||
/* Redo the last thing(s) we undid. */
|
||||
void do_redo(void)
|
||||
{
|
||||
- filestruct *f;
|
||||
+ filestruct *f, *shoveline;
|
||||
char *data, *redidmsg = NULL;
|
||||
undo *u = openfile->undotop;
|
||||
|
||||
@@ -886,7 +889,7 @@ void do_redo(void)
|
||||
break;
|
||||
case ENTER:
|
||||
redidmsg = _("line break");
|
||||
- filestruct *shoveline = make_new_node(f);
|
||||
+ shoveline = make_new_node(f);
|
||||
shoveline->data = mallocstrcpy(NULL, u->strdata);
|
||||
data = mallocstrncpy(NULL, f->data, u->begin + 1);
|
||||
data[u->begin] = '\0';
|
||||
@@ -1396,10 +1399,11 @@ fprintf(stderr, " >> Updating... action = %d, openfile->last_action = %d, openf
|
||||
if ((u->lineno == u->mark_begin_lineno && u->begin < u->mark_begin_x)
|
||||
|| u->lineno < u->mark_begin_lineno) {
|
||||
size_t x_loc = u->begin;
|
||||
+ ssize_t line;
|
||||
u->begin = u->mark_begin_x;
|
||||
u->mark_begin_x = x_loc;
|
||||
|
||||
- ssize_t line = u->lineno;
|
||||
+ line = u->lineno;
|
||||
u->lineno = u->mark_begin_lineno;
|
||||
u->mark_begin_lineno = line;
|
||||
} else
|
||||
@@ -1481,6 +1485,8 @@ bool do_wrap(filestruct *line)
|
||||
/* The next line, minus indentation. */
|
||||
size_t next_line_len = 0;
|
||||
/* The length of next_line. */
|
||||
+ size_t old_x;
|
||||
+ filestruct * oldLine;
|
||||
|
||||
/* There are three steps. First, we decide where to wrap. Then, we
|
||||
* create the new wrap line. Finally, we clean up. */
|
||||
@@ -1528,8 +1534,8 @@ bool do_wrap(filestruct *line)
|
||||
add_undo(SPLIT_BEGIN);
|
||||
#endif
|
||||
|
||||
- size_t old_x = openfile->current_x;
|
||||
- filestruct * oldLine = openfile->current;
|
||||
+ old_x = openfile->current_x;
|
||||
+ oldLine = openfile->current;
|
||||
openfile->current = line;
|
||||
|
||||
/* Step 2, making the new wrap line. It will consist of indentation
|
||||
--
|
||||
2.7.0
|
||||
|
||||
Reference in New Issue
Block a user