ksherlock / mpw-shell

A shell for those that prefer Macintosh Programmer's Workshop.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The embedded command adds an extra space.

ushicow opened this issue · comments

MPW Shell 0.4
# set X "`echo a`"
    echo a
  set X "a "

Carriage returns are converted to spaces in embedded commands. In bash, all extra trailing spaces are stripped. I'll verify that's what MPW does and update it.

std::transform(tmp.begin(), tmp.end(), tmp.begin(), [](uint8_t x){
if (x == '\r' || x == '\n') x = ' ';
return x;
});