diff options
author | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2014-01-22 14:06:31 +0530 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2014-02-04 19:49:46 +1100 |
commit | 41a34055032ac5c64811238fe72f514634285c09 (patch) | |
tree | 0d1a3b4bc6e76d66d129965c365898d9f7a2753b /slof | |
parent | 51802b3dc98fb5ba23dceff6c022811e93f93b39 (diff) | |
download | SLOF-41a34055032ac5c64811238fe72f514634285c09.zip SLOF-41a34055032ac5c64811238fe72f514634285c09.tar.gz SLOF-41a34055032ac5c64811238fe72f514634285c09.tar.bz2 |
Change representation of string environment variable
Currently strings are stored in the dictionary using "string," which
stores the length as a byte. This brings in the limitation of only 255
byte string. The issue got exposed when using "boot-device" which was
more than 256 bytes, and the string length was equal to (length & 0xFF)
With this patch, we are storing the length in dictionary in a cell and
copying the string after that.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Diffstat (limited to 'slof')
-rw-r--r-- | slof/fs/envvar.fs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/slof/fs/envvar.fs b/slof/fs/envvar.fs index d2ca60d..3364313 100644 --- a/slof/fs/envvar.fs +++ b/slof/fs/envvar.fs @@ -31,7 +31,7 @@ wordlist CONSTANT envvars 2 c, align dup , here swap dup allot move DOES> char+ aligned dup @ >r cell+ r> ; -: env-string ( str len -- ) 3 c, string, DOES> char+ count ; +: env-string ( str len -- ) 3 c, align dup , here over allot swap move DOES> char+ aligned dup @ >r cell+ r> ; : env-flag ( f -- ) 4 c, c, DOES> char+ c@ 0<> ; : env-secmode ( sm -- ) 5 c, c, DOES> char+ c@ ; @@ -117,7 +117,7 @@ wordlist CONSTANT envvars CASE 1 OF aligned @ . ENDOF 2 OF aligned dup cell+ swap @ swap . . ENDOF - 3 OF count type ENDOF + 3 OF aligned dup @ >r cell+ r> type ENDOF 4 OF c@ IF ." true" ELSE ." false" THEN ENDOF 5 OF c@ . ENDOF \ XXX: print symbolically ENDCASE @@ -204,7 +204,7 @@ VARIABLE nvoff \ offset in envvar partition CASE 1 OF aligned @ (.d) ENDOF 2 OF drop 0 0 ENDOF - 3 OF count ENDOF + 3 OF aligned dup @ >r cell+ r> ENDOF 4 OF c@ IF s" true" ELSE s" false" THEN ENDOF 5 OF c@ (.) ENDOF \ XXX: print symbolically ENDCASE |