diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-05-28 14:53:38 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-05-28 14:53:38 -0700 |
commit | 8bbc2eecee419f60ede3d7582c075d6997f0ff8c (patch) | |
tree | c8a2db6eaf258e19f77918ea79e3f1277426e36a | |
parent | dfc9d5756f068d051195604e52cad3a501a6cdfb (diff) | |
download | txr-8bbc2eecee419f60ede3d7582c075d6997f0ff8c.tar.gz txr-8bbc2eecee419f60ede3d7582c075d6997f0ff8c.tar.bz2 txr-8bbc2eecee419f60ede3d7582c075d6997f0ff8c.zip |
Use byte-oriented stream in binary editing utility.
* txr-embedded-arg.txr (stream-positioned-to-right-place):
Call stream-set-prop to mark stream as byte oriented.
This is for the sake of the MinGW port, where reading
binary files with UTF-8 decoding can throw errors about
unsupported Unicode characters (those beyond 0xFFFF).
-rwxr-xr-x | txr-embedded-arg.txr | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/txr-embedded-arg.txr b/txr-embedded-arg.txr index fb167508..584a8a6e 100755 --- a/txr-embedded-arg.txr +++ b/txr-embedded-arg.txr @@ -1,7 +1,8 @@ @(do (defun stream-positioned-to-right-place (name) (let* ((stream (open-file name "r+b")) - (pre (read-until-match #/@\(txr\)/ stream t))) + (pre (progn (stream-set-prop stream :byte-oriented t) + (read-until-match #/@\(txr\)/ stream t)))) (when (or (empty pre) (not (search-str pre "@(txr)"))) (throwf 'error "~a isn't a TXR executable" name)) stream))) |