strip trailing newline in SCI debugger

svn-id: r38983
This commit is contained in:
Willem Jan Palenstijn 2009-02-28 22:10:07 +00:00
parent 61ab59138a
commit e159979869

View File

@ -87,8 +87,11 @@ const char *_debug_get_input_default() {
printf("> "); printf("> ");
fgets(newinpbuf, 254, stdin); fgets(newinpbuf, 254, stdin);
if (strlen(newinpbuf) != 0) size_t l = strlen(newinpbuf);
if (l > 0 && newinpbuf[0] != '\n') {
if (newinpbuf[l-1] == '\n') newinpbuf[l-1] = 0;
memcpy(inputbuf, newinpbuf, 256); memcpy(inputbuf, newinpbuf, 256);
}
return inputbuf; return inputbuf;
} }