Have tried to attach a zip-archive (and also a version renamed to .txt as 
Sourceforge does not allow
files ending in "zip") in order to make the files available in an unchanged 
format.

Here a temporary Dropbbox link to that zip-archive:
<https://www.dropbox.com/s/svdkufxld7vj81h/src_compiledEncoded.zip?dl=0>.

The zip-archive (renamed to "txt" to allow it to be delivered via Sourceforge) 
which contains these
three files:

    F:\work\svn\bsf4oorexx\trunk\bsf4oorexx\samples\JavaFX\fxml_01>unzip -v 
src_compiledEncoded.zip
    Archive:  src_compiledEncoded.zip
     Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
    --------  ------  ------- ---- ---------- ----- --------  ----
       14932  Defl:X     4311  71% 25.08.2020 16:37 e3451473  
fxml_01_controller.rex
       14931  Defl:X     4310  71% 25.08.2020 18:13 297511a4  str1.eencoded.rex
        2264  Defl:X     1030  55% 14.08.2020 16:59 8a7c5fe7  
src/fxml_01_controller.rex
    --------          -------  ---                            -------
       32127             9651  70%                            3 files

On Windows 32-bit "rexx fxml_01_ controller.rex" can be run on the command 
line, "rexx
str1.eencoded.rex" will cause the error 3.905.

The source is in "src/fxml_01_controller.rex"

"str1.eencoded.rex" got created by sending the "makestring" message to the 
string array representing
a compiled and encoded Rexx program.

---rony


On 25.08.2020 19:31, Rony G. Flatscher wrote:
>
> While testing the compiled and encoded Rexx programs in the context of 
> BSF4ooRexx, I found a
> problem that is independent of BSF4ooRexx: sometimes, if creating the 
> sourcecode from the string
> array (makestring will not append a trailing LF) of the compiled and encoded 
> Rexx program it may
> be the case that StringUtils.decodeBase64() runs into an error, if the last 
> encoded line ends in
> "==".
>
> In this case the reason seems to be that the length of the data to be decoded 
> (as determined in
> ProgramMetaData.processRestoreData()) will cause decodeBase64() to assume an 
> error, if no LF (or
> CR-LF) is appended to the last two characters "=="; the test in 
> decodeBase64() is:
>
>                 // if this is '=' and we're looking at
>                 // one of the last two digits, we've hit the
>                 // end
>                 if (ch == '=')
>                 {
>                     // if we're looking for the first digit, then the next 
> character
>                     // muust also be an '='
>                     if (digit == 2)
>                     {
>                         if (inputLength < 2 || *source != '=')
>     ... cut ...
>
> If there is no trailing [CR] LF in this case, then "inputLength < 2" yields 
> true and the decoding
> fails.
>
> One way of dealing with this is to append a LF in any case to the string that 
> gets created for the
> routine or method object from a string array as decodeBase64 is munching 
> trailing [CR] LF.
>
> Would a change like that be o.k.?
>
> ---rony
>
> P.S.: I ran into this problem in a Win32 session, such that I can supply the 
> compiled and encoded
> Rexx programs. The one with a trailing LF works, the other without the 
> trailing LF will cause:
> Error 3.905:  Encoded compiled program
> "F:\work\svn\bsf4oorexx\trunk\bsf4oorexx\samples\JavaFX\fxml_01\str1.eencoded.rex"
>  cannot be decoded.
>

_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to