Skip to content

Commit 6129eca

Browse files
committed
FIX: find/same and select/same working with any-word!
related to: Oldes/Rebol-issues#1720 and Oldes/Rebol-issues#1830
1 parent b53caf8 commit 6129eca

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/core/t-block.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static void No_Nones_Or_Logic(REBVAL *arg) {
119119
value = BLK_SKIP(series, index);
120120
if (ANY_WORD(value)) {
121121
cnt = (VAL_WORD_SYM(value) == VAL_WORD_SYM(target));
122-
if (flags & AM_FIND_CASE) {
122+
if (flags & (AM_FIND_CASE | AM_FIND_SAME)) {
123123
// Must be same type and spelling:
124124
if (cnt && VAL_TYPE(value) == VAL_TYPE(target)) return index;
125125
}

src/tests/units/series-test.r3

+8
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ Rebol [
7777
--assert 2 = index? find b :obj1
7878
--assert 2 = index? find b :obj2
7979
--assert 2 = index? find/case b :obj2 ;/case is not /same in this case
80+
b: [a a: 'a :a]
81+
--assert 1 = index? find/same b b/1
82+
--assert 2 = index? find/same b b/2
83+
--assert 3 = index? find/same b b/3
84+
--assert 4 = index? find/same b b/4
85+
--assert 1 = index? find b b/1
86+
--assert 1 = index? find b b/2
87+
--assert 1 = index? find b b/3
8088

8189
--test-- "FIND/SAME in string!"
8290
--assert "AbcdAe" = find/same "aAbcdAe" "A"

0 commit comments

Comments
 (0)