[Scummvm-cvs-logs] SF.net SVN: scummvm:[38983] scummvm/trunk/engines/sci/engine/scriptdebug. cpp

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Sat Feb 28 23:10:08 CET 2009


Revision: 38983
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38983&view=rev
Author:   wjpalenstijn
Date:     2009-02-28 22:10:07 +0000 (Sat, 28 Feb 2009)

Log Message:
-----------
strip trailing newline in SCI debugger

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/scriptdebug.cpp

Modified: scummvm/trunk/engines/sci/engine/scriptdebug.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-02-28 21:59:49 UTC (rev 38982)
+++ scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-02-28 22:10:07 UTC (rev 38983)
@@ -87,8 +87,11 @@
 	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;
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list