From b3c6b40550130bace73877d71b2eae83ebb9e47e Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Mon, 7 Nov 2005 06:20:02 +0000
Subject: [PATCH] in update_line(), remove now-unneeded logic that set the
 index parameter to zero if the fileptr parameter didn't point to current

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3097 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog   |  3 +++
 src/winio.c | 10 +++-------
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 110aa5e0..7ff674f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -76,6 +76,9 @@ CVS code -
 - winio.c:
   nanoget_repaint()
 	- Rename parameter inputbuf to buf, for consistency. (DLR)
+  update_line()
+	- Remove now-unneeded logic that set the index parameter to zero
+	  if the fileptr parameter didn't point to current. (DLR)
   edit_add()
 	- Rename to edit_draw(), and rename parameter yval to line.
 	  (DLR)
diff --git a/src/winio.c b/src/winio.c
index 3fc4b27e..4b7c9f9f 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -2541,11 +2541,8 @@ void edit_draw(const filestruct *fileptr, const char *converted, int
 }
 
 /* Just update one line in the edit buffer.  This is basically a wrapper
- * for edit_draw().
- *
- * If fileptr != current, then index is considered 0.  The line will be
- * displayed starting with fileptr->data[index].  Likely args are
- * current_x or 0. */
+ * for edit_draw().  The line will be displayed starting with
+ * fileptr->data[index].  Likely arguments are current_x or zero. */
 void update_line(const filestruct *fileptr, size_t index)
 {
     int line;
@@ -2570,8 +2567,7 @@ void update_line(const filestruct *fileptr, size_t index)
 
     /* Next, convert variables that index the line to their equivalent
      * positions in the expanded line. */
-    index = (fileptr == openfile->current) ? strnlenpt(fileptr->data,
-	index) : 0;
+    index = strnlenpt(fileptr->data, index);
     page_start = get_page_start(index);
 
     /* Expand the line, replacing tabs with spaces, and control
-- 
GitLab