Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Unified Diff: base/third_party/xdg_mime/xdgmimeint.c

Issue 10824186: Linux: update base/third_party/xdg_mime from upstream. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/third_party/xdg_mime/xdgmimeint.h ('k') | base/third_party/xdg_mime/xdgmimemagic.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/third_party/xdg_mime/xdgmimeint.c
===================================================================
--- base/third_party/xdg_mime/xdgmimeint.c (revision 150109)
+++ base/third_party/xdg_mime/xdgmimeint.c (working copy)
@@ -26,7 +26,7 @@
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include "xdgmimeint.h"
@@ -189,3 +189,18 @@
}
}
+const char *
+_xdg_binary_or_text_fallback(const void *data, size_t len)
+{
+ unsigned char *chardata;
+ int i;
+
+ chardata = (unsigned char *) data;
+ for (i = 0; i < 32 && i < len; ++i)
+ {
+ if (chardata[i] < 32 && chardata[i] != 9 && chardata[i] != 10 && chardata[i] != 13)
+ return XDG_MIME_TYPE_UNKNOWN; /* binary data */
+ }
+
+ return XDG_MIME_TYPE_TEXTPLAIN;
+}
« no previous file with comments | « base/third_party/xdg_mime/xdgmimeint.h ('k') | base/third_party/xdg_mime/xdgmimemagic.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698