]> git.wh0rd.org Git - nano.git/commitdiff
Rearranging a few lines plus some whitespace.
authorBenno Schulenberg <bensberg@justemail.net>
Fri, 10 Jul 2015 17:49:30 +0000 (17:49 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Fri, 10 Jul 2015 17:49:30 +0000 (17:49 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5292 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/files.c

index fc70a676a3c51fcc2691d48409e2de7c18079d42..139abe9339ed44b6703a8360fcb2fb58321f7a54 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@
        * src/files.c: Unwrap some lines and rewrap some others in a more
        congenial manner; tweak some comments and whitespace and braces.
        * src/files.c (read_line): Remove two lines of dead code.
+       * src/files.c (read_line): Rearrange a few lines and some whitespace.
 
 2015-07-06  Benno Schulenberg  <bensberg@justemail.net>
        * src/global.c (add_to_sclist), src/help.c (help_init), src/nano.h,
index 5f0fb12b9745880904f42a4e0030227f4a01fc7a..53a34e558e23f2bf8dca74af9774cd9b886cfecf 100644 (file)
@@ -590,18 +590,18 @@ filestruct *read_line(char *buf, filestruct *prevnode, bool
        /* Special case: we're inserting into the first line. */
        fileptr->prev = NULL;
        fileptr->next = openfile->fileage;
+       openfile->fileage = fileptr;
        fileptr->lineno = 1;
-           *first_line_ins = FALSE;
        /* Make sure that our edit window stays on the first line. */
-           openfile->edittop = fileptr;
-       openfile->fileage = fileptr;
+       openfile->edittop = fileptr;
+       *first_line_ins = FALSE;
     } else {
        assert(prevnode != NULL);
 
+       prevnode->next = fileptr;
        fileptr->prev = prevnode;
        fileptr->next = NULL;
        fileptr->lineno = prevnode->lineno + 1;
-       prevnode->next = fileptr;
     }
 
     return fileptr;