WeiDUorg / weidu

WeiDU is a program used to develop, distribute and install modifications for games based on the Infinity Engine.
http://www.weidu.org
GNU General Public License v2.0
87 stars 19 forks source link

APPEND_FILE(_EVALUATE) with the TEXT argument should not fail when called in an empty buffer #238

Closed Argent77 closed 3 months ago

Argent77 commented 6 months ago

Observed: APPEND_FILE and APPEND_FILE_EVALUATE fail with the message ERROR: Invalid_argument("String.sub / Bytes.sub") if the TEXT argument is specified and the patch buffer is empty.

Expected: APPEND_FILE and APPEND_FILE_EVALUATE should properly append the content of the given file to the buffer when the TEXT argument is specified.

Example code:

<<<<<<<< .../inlined/block.baf
IF
  False()
THEN
  RESPONSE #100
    NoAction()
END
>>>>>>>>

OUTER_PATCH_SAVE script ~~ BEGIN
  APPEND_FILE TEXT ~.../inlined/block.baf~
END
FredrikLindgren commented 3 months ago

Fixed in 03b418b084c26df1c7ac39be6a6a64652971521e.