Commit a581036
committed
Pass length constrained mrb string to osc-bridge
When views are created on mruby strings it's possible that the string
pointer points to a longer string than is visible at the ruby level.
In other words strlen(s.pointer) >= s.length. By copying a string we
avoid this edge case.
In the UI this created a bug where it was impossible to delete
characters from a long string.
In ruby you'd start with a string like "foobar"\0(len 6), delete a
character off the end via creating a string view which at the ruby
level was "fooba", but under the hood it was represented via
"fooba"r\0(len 5).
This specific behavior only occurs for non-embeddable strings which in
mruby's case is about roughly 27 characters (compilation flag
dependent).1 parent bbac205 commit a581036
1 file changed
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1134 | 1134 | | |
1135 | 1135 | | |
1136 | 1136 | | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
1137 | 1151 | | |
1138 | 1152 | | |
1139 | 1153 | | |
| |||
1148 | 1162 | | |
1149 | 1163 | | |
1150 | 1164 | | |
1151 | | - | |
| 1165 | + | |
1152 | 1166 | | |
| 1167 | + | |
1153 | 1168 | | |
1154 | 1169 | | |
1155 | 1170 | | |
| |||
0 commit comments