Don't treat whitespace as control chars.
authorAlexander Larsson <alexl@redhat.com>
Tue, 29 Jan 2008 14:19:46 +0000 (14:19 +0000)
committerAlexander Larsson <alexl@src.gnome.org>
Tue, 29 Jan 2008 14:19:46 +0000 (14:19 +0000)
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

gio/ChangeLog
gio/gcontenttype.c

index 762f744..3fc948f 100644 (file)
@@ -1,5 +1,10 @@
 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>
+
         * gdesktopappinfo.c:
        Lazily create the desktop files for appinfos created
        by g_app_info_create_from_commandline() when needed
index 97eef6a..a5cc41f 100644 (file)
@@ -671,9 +671,14 @@ static gboolean
 looks_like_text (const guchar *data, gsize data_size)
 {
   gsize i;
+  char c;
+  
   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 TRUE;