diff options
author | Bastien Nocera <hadess@hadess.net> | 2017-09-05 14:14:53 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2017-09-05 14:14:53 +0200 |
commit | 9c5802b8da56187c5c6abaf70042d14b12d832a9 (patch) | |
tree | 9453493c2aba027967b43d0c8682a255a619a776 | |
parent | f69fd2528ec0ebdbe48983ad3eabd002de7ba2bd (diff) |
Check further into the file whether it is text or binary
We were only checking 32 bytes into the file, which might not be enough
for some tar archives with long filenames.
https://bugs.freedesktop.org/show_bug.cgi?id=97372
-rw-r--r-- | src/xdgmimeint.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xdgmimeint.c b/src/xdgmimeint.c index cf789d9..9f33803 100644 --- a/src/xdgmimeint.c +++ b/src/xdgmimeint.c @@ -196,7 +196,7 @@ _xdg_binary_or_text_fallback(const void *data, size_t len) int i; chardata = (unsigned char *) data; - for (i = 0; i < 32 && i < len; ++i) + for (i = 0; i < 128 && i < len; ++i) { if (chardata[i] < 32 && chardata[i] != 9 && chardata[i] != 10 && chardata[i] != 13) return XDG_MIME_TYPE_UNKNOWN; /* binary data */ |