fix: handle nil env vars in backend-size
parse-integer errors on nil input. Guard with when before parsing.
This commit is contained in:
@@ -185,10 +185,10 @@ as a fallback when a keyword is not in *named-colors*.")
|
|||||||
;; $LINES from the shell, which reflect the true size at
|
;; $LINES from the shell, which reflect the true size at
|
||||||
;; process start even when ioctl on stdout's fd disagrees.
|
;; process start even when ioctl on stdout's fd disagrees.
|
||||||
(or (ignore-errors
|
(or (ignore-errors
|
||||||
(let ((cols (parse-integer (sb-ext:posix-getenv "COLUMNS")
|
(let* ((cstr (sb-ext:posix-getenv "COLUMNS"))
|
||||||
:junk-allowed t))
|
(rstr (sb-ext:posix-getenv "LINES"))
|
||||||
(rows (parse-integer (sb-ext:posix-getenv "LINES")
|
(cols (when cstr (parse-integer cstr :junk-allowed t)))
|
||||||
:junk-allowed t)))
|
(rows (when rstr (parse-integer rstr :junk-allowed t))))
|
||||||
(when (and cols rows (> cols 0) (> rows 0))
|
(when (and cols rows (> cols 0) (> rows 0))
|
||||||
(values cols rows))))
|
(values cols rows))))
|
||||||
(values w h)))))
|
(values w h)))))
|
||||||
|
|||||||
@@ -44,10 +44,10 @@
|
|||||||
(if (and (> w 80) (> h 24))
|
(if (and (> w 80) (> h 24))
|
||||||
(values w h)
|
(values w h)
|
||||||
(or (ignore-errors
|
(or (ignore-errors
|
||||||
(let ((cols (parse-integer (sb-ext:posix-getenv "COLUMNS")
|
(let* ((cstr (sb-ext:posix-getenv "COLUMNS"))
|
||||||
:junk-allowed t))
|
(rstr (sb-ext:posix-getenv "LINES"))
|
||||||
(rows (parse-integer (sb-ext:posix-getenv "LINES")
|
(cols (when cstr (parse-integer cstr :junk-allowed t)))
|
||||||
:junk-allowed t)))
|
(rows (when rstr (parse-integer rstr :junk-allowed t))))
|
||||||
(when (and cols rows (> cols 0) (> rows 0))
|
(when (and cols rows (> cols 0) (> rows 0))
|
||||||
(values cols rows))))
|
(values cols rows))))
|
||||||
(values w h)))))
|
(values w h)))))
|
||||||
|
|||||||
Reference in New Issue
Block a user