mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 06:26:15 +01:00
Bug 598712 - can't detect text file with backspace
looks_like_text(): Allow '\b' to appear in text files.
This commit is contained in:
parent
230745a350
commit
48e2a57043
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user