Skip to content

Commit

Permalink
FIX: removing ANSI escape char from White_Chars table
Browse files Browse the repository at this point in the history
Else TRIM is eating it and so making invalid ANSI escape sequence
Before this change:
```
>> trim "  ^[[4AHello"
== "[4AHello"

```
Now:
```
>> trim "  ^[[4AHello"
== "^[[4AHello"
```
Note that in this example "^[[4A" is ANSI escape sequence which tells that cursor should be moved 4 lines up
  • Loading branch information
Oldes committed Oct 11, 2018
1 parent 4707611 commit 4ff49a8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/s-cases.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,7 @@ static short const Char_Cases[] = {
White_Chars[' '] = 3; // space
White_Chars['\t'] = 3; // space
White_Chars[0] = 0; // special
White_Chars[27] = 0; // special (ANSI escape)

// Casing tables:
Upper_Cases = Make_Mem(UNICODE_CASES * sizeof(REBUNI));
Expand Down

0 comments on commit 4ff49a8

Please sign in to comment.