diff options
Diffstat (limited to 'engines/sci/engine/scriptdebug.cpp')
-rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 0accce7e94..30309a894b 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -87,8 +87,11 @@ const char *_debug_get_input_default() { printf("> "); 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); + } return inputbuf; } |