WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Editing long lines in pygrub interactivel

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Editing long lines in pygrub interactively could lead to tracebacks.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 28 Mar 2007 10:10:17 -0700
Delivery-date: Wed, 28 Mar 2007 10:09:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1175073136 0
# Node ID ff6a1607c17b2e1f2e8b09e8722097f50e16c715
# Parent  b7c1b412c4727ad8c8e190d8c053ab78a09e390e
Editing long lines in pygrub interactively could lead to tracebacks.
Attached patch fixes things.

Signed-off-by: Jeremy Katz <katzj@xxxxxxxxxx>
---
 tools/pygrub/src/pygrub |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diff -r b7c1b412c472 -r ff6a1607c17b tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub   Wed Mar 28 10:05:03 2007 +0100
+++ b/tools/pygrub/src/pygrub   Wed Mar 28 09:12:16 2007 +0000
@@ -125,16 +125,13 @@ class GrubLineEditor(curses.textpad.Text
         is that we can handle lines longer than the window."""
 
         self.win.clear()
-        if self.pos > 70:
-            if self.pos > 130:
-                off = 120
-            else:
-                off = 55
-            l = [ "<" ] + self.line[off:]
-            p = self.pos - off
-        else:
-            l = self.line[:70]
-            p = self.pos
+        p = self.pos
+        off = 0
+        while p > 70:
+            p -= 55
+            off += 55
+
+        l = self.line[off:off+70]
         self.win.addstr(0, 0, string.join(l, ("")))
         if self.pos > 70:
             self.win.addch(0, 0, curses.ACS_LARROW)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Editing long lines in pygrub interactively could lead to tracebacks., Xen patchbot-unstable <=