summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2015-03-23 16:22:56 +0000
committerdteske <dteske@FreeBSD.org>2015-03-23 16:22:56 +0000
commit1c252bf2ede306beed13cb57df9d097f963b6aba (patch)
tree8096b8d6a7cfb686db10f425bfe8b647c6c52b48 /sys/boot
parent88b4a1910a44ef9da0f1ddb121776a9c231b7bea (diff)
downloadFreeBSD-src-1c252bf2ede306beed13cb57df9d097f963b6aba.zip
FreeBSD-src-1c252bf2ede306beed13cb57df9d097f963b6aba.tar.gz
Fix sgetkey indentation to be consistent with the rest of the file.
Remove some blank lines, adjust some comments and update copyright. MFC after: 3 days X-MFC-to: stable/10 stable/9
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/forth/check-password.4th51
1 files changed, 23 insertions, 28 deletions
diff --git a/sys/boot/forth/check-password.4th b/sys/boot/forth/check-password.4th
index 26d6b94..184c9c5 100644
--- a/sys/boot/forth/check-password.4th
+++ b/sys/boot/forth/check-password.4th
@@ -1,4 +1,4 @@
-\ Copyright (c) 2006-2012 Devin Teske <dteske@FreeBSD.org>
+\ Copyright (c) 2006-2015 Devin Teske <dteske@FreeBSD.org>
\ All rights reserved.
\
\ Redistribution and use in source and binary forms, with or without
@@ -48,33 +48,29 @@ variable readlen \ input length
\
: sgetkey ( -- )
- begin \ Loop forever
- key? if \ Was a key pressed? (see loader(8))
-
- drop \ Remove stack-cruft
- key \ Get the key that was pressed
-
- \ Check key pressed (see loader(8)) and input limit
- dup 0<> if ( and ) readlen @ readmax < if
-
- \ Echo an asterisk (unless Backspace/Enter)
- dup bs_key <> if ( and ) dup enter_key <> if
- ." *" \ Echo an asterisk
- then then
-
- exit \ Exit from the function
- then then
-
- \ Always allow Backspace and Enter
- dup bs_key = if exit then
- dup enter_key = if exit then
-
- then
- 50 ms \ Sleep for 50 milliseconds (see loader(8))
- again
+ begin \ Loop forever
+ key? if \ Was a key pressed? (see loader(8))
+ drop \ Remove stack-cruft
+ key \ Get the key that was pressed
+
+ \ Check key pressed (see loader(8)) and input limit
+ dup 0<> if ( and ) readlen @ readmax < if
+ \ Echo an asterisk (unless Backspace/Enter)
+ dup bs_key <> if ( and ) dup enter_key <> if
+ ." *" \ Echo an asterisk
+ then then
+ exit
+ then then
+
+ \ Always allow Backspace and Enter
+ dup bs_key = if exit then
+ dup enter_key = if exit then
+ then
+ 50 ms \ Sleep for 50 milliseconds (see loader(8))
+ again
;
-: read ( String prompt -- )
+: read ( c-addr/u -- ) \ Expects string prompt as stack input
0 25 at-xy \ Move the cursor to the bottom-left
dup 1+ read-start ! \ Store X offset after the prompt
@@ -127,8 +123,7 @@ variable readlen \ input length
then then
- drop \ drop the last key that was entered
-
+ drop \ last key pressed
again \ Enter was not pressed; repeat
;
OpenPOWER on IntegriCloud