From e1599798693eedc88e7fa2545e0976d89d9fa736 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 28 Feb 2009 22:10:07 +0000 Subject: [PATCH] strip trailing newline in SCI debugger svn-id: r38983 --- engines/sci/engine/scriptdebug.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 0accce7e942..30309a894ba 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; }