From c86f714a151039a6d794288e663dd2a734b44073 Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Mon, 7 Aug 2000 14:39:32 +0000 Subject: [PATCH] No more cutting the macic line, added check_statblank() to cut and uncut git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@174 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 5 +++++ cut.c | 18 +++++------------- po/nano.pot | 8 ++++---- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index fb835743..fb567420 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ CVS code - cut.c: do_cut_text() - Fixed getting locked into cutbuffer on cutting first line of file. + - Added check_statblank(). + - Check for fileptr == filebot, if so return, we shouldn't bother + cutting the magic line. + do_uncut_text() + - Added check_statblank(). - nano.c: main() - Changed tabsize long arg to actually accept an argument *sigh*. diff --git a/cut.c b/cut.c index 48b01727..ddc9e934 100644 --- a/cut.c +++ b/cut.c @@ -136,7 +136,8 @@ int do_cut_text(void) int newsize, cuttingtoend = 0; #endif - if (fileptr == NULL || fileptr->data == NULL) + check_statblank(); + if (fileptr == NULL || fileptr->data == NULL || fileptr == filebot) return 0; tmp = fileptr->next; @@ -242,18 +243,8 @@ int do_cut_text(void) current = fileptr->next; totlines--; totsize--; /* get the newline */ - } else { - /* we're deleteing the last line - and replacing it with a dummy line, - so totlines is the same */ - tmp = fileptr->prev; - tmp->next = make_new_node(tmp); - tmp = tmp->next; - tmp->data = nmalloc(1); - strcpy(tmp->data, ""); - current = tmp; - filebot = tmp; - } + } /* No longer an else here, because we never get here anymore... + No need to cut the magic line, as it's empty */ add_to_cutbuffer(fileptr); } @@ -285,6 +276,7 @@ int do_uncut_text(void) int i; wrap_reset(); + check_statblank(); if (cutbuffer == NULL || fileptr == NULL) return 0; /* AIEEEEEEEEEEEE */ diff --git a/po/nano.pot b/po/nano.pot index f8b7e6d4..513b61e6 100644 --- a/po/nano.pot +++ b/po/nano.pot @@ -1,12 +1,12 @@ -# Nano strings file. +# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. -# Chris Allegretta , 2000. +# FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2000-08-06 17:19-0400\n" +"POT-Creation-Date: 2000-08-07 10:44-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -19,7 +19,7 @@ msgstr "" msgid "add_to_cutbuffer called with inptr->data = %s\n" msgstr "" -#: cut.c:149 +#: cut.c:150 msgid "Blew away cutbuffer =)\n" msgstr "" -- 2.39.5