File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -573,6 +573,8 @@ static struct digest {
573
573
REBINT len = VAL_LEN (val );
574
574
REBINT n ;
575
575
576
+ if (IS_PROTECT_SERIES (VAL_SERIES (val ))) Trap0 (RE_PROTECTED );
577
+
576
578
if (D_REF (2 )) { //lines
577
579
Set_Block (D_RET , Split_Lines (val ));
578
580
return R_RET ;
@@ -603,6 +605,8 @@ static struct digest {
603
605
REBVAL * val = D_ARG (1 );
604
606
REBSER * ser = VAL_SERIES (val );
605
607
608
+ if (IS_PROTECT_SERIES (VAL_SERIES (val ))) Trap0 (RE_PROTECTED );
609
+
606
610
if (SERIES_TAIL (ser )) {
607
611
if (VAL_BYTE_SIZE (val ))
608
612
Enline_Bytes (ser , VAL_INDEX (val ), VAL_LEN (val ));
Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ Rebol [
39
39
--test-- "swap string" --assert is-protected-error? [swap str "0bad" ]
40
40
--test-- "swap binary" --assert is-protected-error? [swap bin #{ 0bad } ]
41
41
42
+ ;@@ https://github.com/rebol/rebol-issues/issues/2325
43
+ str: protect "a^M^/ b"
44
+ --test-- "deline string" --assert is-protected-error? [deline str]
45
+ --test-- "enline string" --assert is-protected-error? [enline str]
46
+
47
+
42
48
===end-group===
43
49
44
50
~~~end-file~~~
You can’t perform that action at this time.
0 commit comments