CVS code -
+- cut.c:
+ do_uncut_text()
+ - Fix renumbering bug when uncutting marked test at filebot.
+ - Fix screen not being displayed when we are uncutting marked
+ text at editbot (Bug discovered by Ken Tyler).
- files.c:
write_file()
- Change open call flags, basically copy joe's way of doing it so
a more recent version will actually be included in (un)stable.
+- nano.c:
+ renumber()
+ - Dont stupidly assign the value of prev->lineno if prev == NULL!
nano 0.9.23 - 12/08/2000
General
int do_uncut_text(void)
{
- filestruct *tmp = current, *fileptr = current, *newbuf, *newend;
+ filestruct *tmp = current, *hold = current, *fileptr = current, *newbuf, *newend;
#ifndef NANO_SMALL
char *tmpstr, *tmpstr2;
#endif
if (tmp != NULL)
tmp->prev = newend;
- else
+ else {
+ /* Fix the editbot pointer too */
+ if (editbot == filebot)
+ editbot = newend;
filebot = newend;
+ }
/* Now why don't we update the totsize also */
for (tmp = current->next; tmp != newend; tmp = tmp->next)
current_x = 0;
placewewant = 0;
}
- renumber(current->prev);
+ /* Renumber from BEFORE where we pasted ;) */
+ renumber(hold);
+
dump_buffer(fileage);
dump_buffer(cutbuffer);
set_modified();
return 0;
}
for (temp = fileptr; temp != NULL; temp = temp->next) {
- temp->lineno = temp->prev->lineno + 1;
+ if (temp->prev != NULL)
+ temp->lineno = temp->prev->lineno + 1;
+ else
+ temp->lineno = 1;
}
return 0;