[前][次][番号順一覧][スレッド一覧]

ruby-changes:25482

From: knu <ko1@a...>
Date: Thu, 8 Nov 2012 00:36:23 +0900 (JST)
Subject: [ruby-changes:25482] knu:r37539 (trunk): * ext/curses/view.rb: Do not fail if the file to view is shorter

knu	2012-11-08 00:36:14 +0900 (Thu, 08 Nov 2012)

  New Revision: 37539

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37539

  Log:
    * ext/curses/view.rb: Do not fail if the file to view is shorter
      than the screen height.

  Modified files:
    trunk/ChangeLog
    trunk/ext/curses/view.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37538)
+++ ChangeLog	(revision 37539)
@@ -135,6 +135,11 @@
 	   TestRequire#test_require_to_str_redefined_in_load_path):
 	  Suppress method redefined warning when test-all with RUBYOPT=-w.
 
+Thu Nov  8 00:24:14 2012  Akinori MUSHA  <knu@i...>
+
+	* ext/curses/view.rb: Do not fail if the file to view is shorter
+	  than the screen height.
+
 Mon Nov  5 11:40:00 2012  Mark Somerville  <mark@s...>
 
 	* thread_pthread.c (rb_reserved_fd_p): fix typo in macro check
Index: ext/curses/view.rb
===================================================================
--- ext/curses/view.rb	(revision 37538)
+++ ext/curses/view.rb	(revision 37539)
@@ -40,7 +40,7 @@
   while i < lines
     setpos(i, 0)
     #clrtoeol
-    addstr(data_lines[lptr + i]) #if data_lines[lptr + i]
+    addstr(data_lines[lptr + i] || '')
     i += 1
   end
   refresh

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]