From: <fu...@us...> - 2009-06-07 18:49:56
|
Revision: 6352 http://gemrb.svn.sourceforge.net/gemrb/?rev=6352&view=rev Author: fuzzie Date: 2009-06-07 18:49:54 +0000 (Sun, 07 Jun 2009) Log Message: ----------- don't terminate resrefs at the first space Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/DataStream.cpp Modified: gemrb/trunk/gemrb/plugins/Core/DataStream.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/DataStream.cpp 2009-06-07 18:09:00 UTC (rev 6351) +++ gemrb/trunk/gemrb/plugins/Core/DataStream.cpp 2009-06-07 18:49:54 UTC (rev 6352) @@ -164,10 +164,15 @@ { int len = Read(dest, 8); int i; - //zero filling from the first space or in the end - //we got a 9 bytes long buffer - for(i=0;(i<8) && (dest[i]!=' ');i++) dest[i]=(char) tolower(dest[i]); - while(i<9) dest[i++]=0; + // lowercase the resref + for(i = 0; i < 8; i++) { + dest[i] = (char) tolower(dest[i]); + } + // remove trailing spaces + for (i = 7; i >= 0; i--) { + if (dest[i] == ' ') dest[i] = 0; + else break; + } return len; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |