Bug 598712 - can't detect text file with backspace

looks_like_text(): Allow '\b' to appear in text files.
(cherry picked from commit 48e2a57043)
This commit is contained in:
Ryan Lortie
2009-11-20 12:54:35 -06:00
committed by Matthias Clasen
parent 7c177e274a
commit 8a190a155c

View File

@@ -295,7 +295,7 @@ looks_like_text (const guchar *data,
for (i = 0; i < data_size; i++)
{
c = data[i];
if (g_ascii_iscntrl (c) && !g_ascii_isspace (c))
if (g_ascii_iscntrl (c) && !g_ascii_isspace (c) && c != '\b')
return FALSE;
}
return TRUE;
@@ -832,7 +832,8 @@ looks_like_text (const guchar *data, gsize data_size)
c = data[i];
if (g_ascii_iscntrl (c) &&
!g_ascii_isspace (c))
!g_ascii_isspace (c) &&
c != '\b')
return FALSE;
}
return TRUE;