metamath / metamath-exe

Metamath program - source code for the Metamath executable
GNU General Public License v2.0
77 stars 25 forks source link

Simplify and harden `switchPos` #140

Closed digama0 closed 1 year ago

digama0 commented 1 year ago

The original implementation concatenated all the arguments with spaces, which is not correct (causes a segfault) when the arguments themselves can have spaces. Here we use a much simpler mechanism, just searching for / and then MY_SWITCH, taking advantage of the fact that every existing switch is one word.

fixes #136