[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] segv with stty egg
From: |
Christian Kellermann |
Subject: |
Re: [Chicken-users] segv with stty egg |
Date: |
Wed, 23 May 2012 19:48:25 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Maybe the following patch is a suitable solution?
Index: stty.scm
===================================================================
--- stty.scm (revision 26267)
+++ stty.scm (working copy)
@@ -367,16 +367,16 @@
;; high-level interface
(define (stty . args)
+
+ (and-let* ((port (if (and (pair? args) (port? (car args)))
+ (car args)
+ (current-input-port)))
+ (attr (get-terminal-attributes port))
+ (iflag (term-attrs-iflag attr))
+ (oflag (term-attrs-oflag attr))
+ (cflag (term-attrs-cflag attr))
+ (lflag (term-attrs-lflag attr)))
- (let* ((port (if (and (pair? args) (port? (car args)))
- (car args)
- (current-input-port)))
- (attr (get-terminal-attributes port))
- (iflag (term-attrs-iflag attr))
- (oflag (term-attrs-oflag attr))
- (cflag (term-attrs-cflag attr))
- (lflag (term-attrs-lflag attr)))
-
;; parse change requests
(let lp ((lst (if (and (pair? args) (port? (car args))) (cdr args) args))
(flag #t))
--
9 out of 10 voices in my head say, that I am crazy,
one is humming.