better identification and clean up

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5132 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Rafael Barreto
2010-06-01 21:11:08 +00:00
parent fd226ed857
commit af4bfa975b
3 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -197,7 +197,7 @@ int pututf8char(uchar *&d, int s)
}
void filtertext(char *dst, const char *src, int whitespace, int len)
{ // whitespace: no whitespace at all (0), blanks only (1), blanks & newline (2)
{ // whitespace: no whitespace at all (0), blanks only (1), blanks & newline (2), spaces for underlines (-1)
for(int c = *src; c; c = *++src)
{
c &= 0x7F; // 7-bit ascii
@@ -205,8 +205,9 @@ void filtertext(char *dst, const char *src, int whitespace, int len)
{
case '\f': ++src; continue;
}
if(isspace(c) ? whitespace && (whitespace>1 || c == ' ') : isprint(c))
if(isspace(c) ? whitespace && (whitespace>1 || c == ' '): isprint(c))
{
if ( whitespace < 0 && c == ' ' ) c = '_';
*dst++ = c;
if(!--len) break;
}