Bug 598712 - can't detect text file with backspace

looks_like_text(): Allow '\b' to appear in text files.
This commit is contained in:
Ryan Lortie 2009-11-20 12:54:35 -06:00
parent 230745a350
commit 48e2a57043

View File

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