r370 - in trunk/vim/debian: . runtime

Stefano Zacchiroli zack at costa.debian.org
Fri Oct 21 09:29:25 UTC 2005


Author: zack
Date: 2005-10-21 09:29:23 +0000 (Fri, 21 Oct 2005)
New Revision: 370

Modified:
   trunk/vim/debian/changelog
   trunk/vim/debian/runtime/vimrc
Log:
bugfix for vimrc, papersize is now read without using system()


Modified: trunk/vim/debian/changelog
===================================================================
--- trunk/vim/debian/changelog	2005-10-21 08:18:58 UTC (rev 369)
+++ trunk/vim/debian/changelog	2005-10-21 09:29:23 UTC (rev 370)
@@ -12,6 +12,8 @@
     when $SHELL is empty. (closes: #219386)
   * Added patch 304_memline.c.diff, which fixes swap file locking wrt
     symlinks. (closes: #329826)
+  * Changed debian/runtime/vimrc so that /etc/papersize is read without
+    using system(), fixes issues with exotic shells. (closes: #271338)
 
  -- Debian VIM Maintainers <pkg-vim-maintainers at lists.alioth.debian.org>  Mon, 17 Oct 2005 11:23:04 +0200
 

Modified: trunk/vim/debian/runtime/vimrc
===================================================================
--- trunk/vim/debian/runtime/vimrc	2005-10-21 08:18:58 UTC (rev 369)
+++ trunk/vim/debian/runtime/vimrc	2005-10-21 09:29:23 UTC (rev 370)
@@ -52,16 +52,15 @@
 augroup END
 
 " Set paper size from /etc/papersize if available (Debian-specific)
-try
-  if filereadable('/etc/papersize')
-    let s:papersize = matchstr(system('/bin/cat /etc/papersize'), '\p*')
-    if strlen(s:papersize)
-      let &printoptions = "paper:" . s:papersize
-    endif
-    unlet! s:papersize
+if filereadable("/etc/papersize")
+  silent exec "view /etc/papersize"
+  let s:t = getline(".")
+  silent exec "bd!"
+  let s:papersize = matchstr(s:t, "\\p*")
+  if strlen(s:papersize)
+    let &printoptions = "paper:" . s:papersize
   endif
-catch /E145/
-endtry
+endif
 
 " The following are commented out as they cause vim to behave a lot
 " different from regular vi. They are highly recommended though.




More information about the pkg-vim-maintainers mailing list