Hi everyone!
There seems to be a problem with the strupper and strupperk opcodes.
Both seem to retain portions of a previously processed string, which are returned if the current string is shorter than the previous one.
The following code demonstrates the issue:
sr = 44100
0dbfs = 1
nchnls = 1
instr 1
String1 = p4
String2 sprintfk “%s\n”, String1
prints String2
endin
instr 2
String1 = p4
String2 sprintfk “%s\n”, String1
String3 strupper String2
prints String3
endin
instr 3
String1 = p4
String2 sprintfk “%s\n”, String1
String3 strupperk String2
prints String3
endin
i1 0 1 “the longer string”
i1 1 1 “shorter”
i2 2 1 “the longer uppercase string”
i2 3 1 “shorter”
i3 4 1 “the longer uppercase string”
i3 5 1 “shorter”
[running 6.18 on Mac OS 15.1]