]> git.wh0rd.org Git - nano.git/commitdiff
simplify cut_line() further
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Wed, 9 Nov 2005 02:13:07 +0000 (02:13 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Wed, 9 Nov 2005 02:13:07 +0000 (02:13 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3119 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

src/cut.c

index 111d842cca98c00d4333ae1d8bc872f024eb7754..52d51c7a90654a1a7f2a8946acf78fd58be4e4cd 100644 (file)
--- a/src/cut.c
+++ b/src/cut.c
@@ -45,16 +45,12 @@ void cutbuffer_reset(void)
  * place we want to the beginning of the current line. */
 void cut_line(void)
 {
-    size_t data_len = strlen(openfile->current->data);
-
-    assert(openfile->current_x <= data_len);
-
     if (openfile->current != openfile->filebot)
        move_to_filestruct(&cutbuffer, &cutbottom, openfile->current, 0,
                openfile->current->next, 0);
-    else if (data_len > 0)
+    else
        move_to_filestruct(&cutbuffer, &cutbottom, openfile->current, 0,
-               openfile->current, data_len);
+               openfile->current, strlen(openfile->current->data));
 
     openfile->placewewant = 0;
 }