summaryrefslogtreecommitdiff
path: root/stand/forth
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2019-09-20 19:43:40 +0000
committerKyle Evans <kevans@FreeBSD.org>2019-09-20 19:43:40 +0000
commitbb7b569d3654d76f6ebcc869e127d5e221141c32 (patch)
tree763e4d8e923dbaff5083881dd79b9c62ef384af0 /stand/forth
parentb1de37fadd8d5d672065b6a9f9839b021fbeb433 (diff)
downloadsrc-test2-bb7b569d3654d76f6ebcc869e127d5e221141c32.tar.gz
src-test2-bb7b569d3654d76f6ebcc869e127d5e221141c32.zip
Notes
Diffstat (limited to 'stand/forth')
-rw-r--r--stand/forth/color.4th18
1 files changed, 12 insertions, 6 deletions
diff --git a/stand/forth/color.4th b/stand/forth/color.4th
index 65e6de905ac6..fc5a4d564d0a 100644
--- a/stand/forth/color.4th
+++ b/stand/forth/color.4th
@@ -27,12 +27,14 @@
marker task-color.4th
\ This function returns FALSE if the `loader_color' environment variable is set
-\ to NO, no, or 0. Otherwise, TRUE is returned (unless booting serial).
+\ to NO, no, or 0. It returns TRUE if `loader_color' is set to any other value.
+\ If `loader_color' is unset, TRUE is returned (unless booting serial).
\
-: loader_color? ( -- N )
+: loader_color? ( -- t )
s" loader_color" getenv dup -1 <> if
-
+ \ `loader_color' is set.
+ \ Check if it is explicitly disabled.
2dup s" NO" compare-insensitive 0= if
2drop
FALSE exit
@@ -42,8 +44,12 @@ marker task-color.4th
FALSE exit
then
drop
+ \ It is enabled.
+ TRUE
+ else
+ \ `loader_color' is unset.
+ \ Default to using color unless serial boot is active.
+ drop
+ boot_serial? 0=
then
- drop
-
- boot_serial? if FALSE else TRUE then
;