aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuediger Hanke2002-08-25 22:25:18 +0000
committerRuediger Hanke2002-08-25 22:25:18 +0000
commit1673f0174e7aa443f9a15640c9cc650e85d9f3fb (patch)
treee367299e704bd70b834100b350cc4e296cc70cd0
parentb295fd0bbd6a7ca55625adbd4b755f9ab847faeb (diff)
downloadscummvm-rg350-1673f0174e7aa443f9a15640c9cc650e85d9f3fb.tar.gz
scummvm-rg350-1673f0174e7aa443f9a15640c9cc650e85d9f3fb.tar.bz2
scummvm-rg350-1673f0174e7aa443f9a15640c9cc650e85d9f3fb.zip
German FT TRES file has a multiline string which caused an assertion failure
svn-id: r4860
-rw-r--r--scumm/smush/player.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/scumm/smush/player.cpp b/scumm/smush/player.cpp
index d3896dbe41..25254fbacf 100644
--- a/scumm/smush/player.cpp
+++ b/scumm/smush/player.cpp
@@ -105,6 +105,19 @@ public:
assert(value);
memcpy(value, data_start, data_end - data_start);
value[data_end - data_start] = 0;
+ char * line_start = value;
+ char * line_end;
+ while (line_end = strchr(line_start, '\n')) {
+ line_start = line_end+1;
+ if (line_start[0] == '/' && line_start[1] == '/') {
+ line_start += 2;
+ if (line_end[-1] == '\r')
+ line_end[-1] = ' ';
+ else
+ *line_end++ = ' ';
+ memmove(line_end, line_start, strlen(line_start)+1);
+ }
+ }
#ifdef DEBUG
debug(9, "Inserting (%s)%d == \"%s\"", idstring, id, value);
#endif