summaryrefslogtreecommitdiffstats
path: root/txr-embedded-arg.txr
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-05-28 14:53:38 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-05-28 14:53:38 -0700
commit757f79a369ca63faa8934512f4a53d4cec4f8fd0 (patch)
treec8a2db6eaf258e19f77918ea79e3f1277426e36a /txr-embedded-arg.txr
parent42367d8856e5476245b218e1b2bbf416a0341327 (diff)
downloadtxr-757f79a369ca63faa8934512f4a53d4cec4f8fd0.tar.gz
txr-757f79a369ca63faa8934512f4a53d4cec4f8fd0.tar.bz2
txr-757f79a369ca63faa8934512f4a53d4cec4f8fd0.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).
Diffstat (limited to 'txr-embedded-arg.txr')
-rwxr-xr-xtxr-embedded-arg.txr3
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)))