Don't treat whitespace as control chars.

2008-01-29  Alexander Larsson  <alexl@redhat.com>

	* gcontenttype.c (looks_like_text):
	Don't treat whitespace as control chars.


svn path=/trunk/; revision=6414
This commit is contained in:
Alexander Larsson 2008-01-29 14:19:46 +00:00 committed by Alexander Larsson
parent 1fcaf2fe8d
commit 1efe9d9cd1
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2008-01-29 Alexander Larsson <alexl@redhat.com>
* gcontenttype.c (looks_like_text):
Don't treat whitespace as control chars.
2008-01-29 Alexander Larsson <alexl@redhat.com> 2008-01-29 Alexander Larsson <alexl@redhat.com>
* gdesktopappinfo.c: * gdesktopappinfo.c:

View File

@ -671,9 +671,14 @@ static gboolean
looks_like_text (const guchar *data, gsize data_size) looks_like_text (const guchar *data, gsize data_size)
{ {
gsize i; gsize i;
char c;
for (i = 0; i < data_size; i++) for (i = 0; i < data_size; i++)
{ {
if g_ascii_iscntrl (data[i]) c = data[i];
if (g_ascii_iscntrl (c) &&
!g_ascii_isspace (c))
return FALSE; return FALSE;
} }
return TRUE; return TRUE;