Skip to content

Commit 767fd06

Browse files
committed
FIX: Enbase is not working correctly with series which are not at head
Fixes: metaeducation/rebol-issues#319
1 parent fb72927 commit 767fd06

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/core/f-enbase.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@
632632
REBINT x, loop;
633633

634634
len = VAL_LEN(value);
635-
src = VAL_BIN(value);
635+
src = VAL_BIN_DATA(value);
636636

637637
const REBYTE *table;
638638
if(urlSafe) {

src/tests/units/enbase-test.r3

+8
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ Rebol [
2727
--test-- "enbase-14" --assert "666F6F626172" = enbase/base "foobar" 16
2828
===end-group===
2929

30+
===start-group=== "enbase with position not at head"
31+
;@@ https://github.com/rebol/rebol-issues/issues/319
32+
bin: #{FF00FF00}
33+
--test-- "enbase-2" --assert #{00FF00} = debase/base enbase/base next bin 2 2
34+
--test-- "enbase-16" --assert #{00FF00} = debase/base enbase/base next bin 16 16
35+
--test-- "enbase-64" --assert #{00FF00} = debase enbase next bin
36+
===end-group===
37+
3038
===start-group=== "debase 64"
3139

3240
--test-- "debase 64 1"

0 commit comments

Comments
 (0)