File: hemlock-termcap-fix.patch

package info (click to toggle)
cmucl 20c-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 42,524 kB
  • sloc: lisp: 358,331; ansic: 28,385; asm: 3,777; sh: 1,236; makefile: 366; csh: 31
file content (31 lines) | stat: -rw-r--r-- 1,112 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Description: We need to get termcap info from infocmp not from a file on debian
Author: Peter Van Eynde <pvaneynd@debian.org>
Forwarded: TBD


Index: b/src/hemlock/termcap.lisp
===================================================================
--- a/src/hemlock/termcap.lisp	2011-12-06 09:05:31.531799980 +0000
+++ b/src/hemlock/termcap.lisp	2011-12-06 09:05:40.788425823 +0000
@@ -39,10 +39,18 @@
 	    (with-input-from-string (s termcap-env-var)
 	      (skip-termcap-names s)
 	      (parse-fields s)))
-	(with-open-file (s termcap-file)
-	  (if (find-termcap-entry name s)
+	(let* ((proc 
+		 (ext:run-program "/usr/bin/infocmp"
+		                  (list (cdr (assoc :TERM *ENVIRONMENT-LIST*)))
+		         	:wait nil
+			 	:input nil
+			 	:output :stream))
+	        (s (process-output proc)))
+	  (unwind-protect
+	(if (find-termcap-entry name s)
 	      (parse-fields s)
-	      (error "Unknown Terminal ~S in file ~S." name termcap-file))))))
+	      (error "Unknown Terminal ~S in file ~S." name termcap-file))
+	(process-close proc))))))
 
 (declaim (inline termcap))
 (defun termcap (name termcap)