summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-09-16 23:15:09 +0300
committerToomas Soome <tsoome@me.com>2019-09-17 23:11:21 +0300
commite141bae1eadd4373d692c722ab88dff7d998a3b8 (patch)
tree24cc6d81d2d7cd20916fdacf1e5323b6672738e2
parente982f11fb2fc266a3d04a69ea3edcf51f44b1e0f (diff)
downloadillumos-joyent-e141bae1eadd4373d692c722ab88dff7d998a3b8.tar.gz
11696 loader: scan_buffer can leave empty string on stack
Reviewed by: Rob Johnston <rob.johnston@joyent.com> Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/boot/sys/boot/forth/support.4th2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr/src/boot/sys/boot/forth/support.4th b/usr/src/boot/sys/boot/forth/support.4th
index 31420929d9..3144b302f1 100644
--- a/usr/src/boot/sys/boot/forth/support.4th
+++ b/usr/src/boot/sys/boot/forth/support.4th
@@ -403,6 +403,7 @@ variable fd
;
: line_buffer_resize ( len -- len )
+ dup 0= if exit then
>r
line_buffer .len @ if
line_buffer .addr @
@@ -416,6 +417,7 @@ variable fd
;
: append_to_line_buffer ( addr len -- )
+ dup 0= if 2drop exit then
line_buffer strget
2swap strcat
line_buffer .len !