mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
xdgmime: Use g_pattern_match_simple() instead of fnmatch() for Win32 compatibility
This commit is contained in:
parent
e571138ef6
commit
f957ee0aeb
5 changed files with 4 additions and 7 deletions
|
@ -35,7 +35,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <fnmatch.h>
|
|
||||||
|
|
||||||
#ifndef FALSE
|
#ifndef FALSE
|
||||||
#define FALSE (0)
|
#define FALSE (0)
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fnmatch.h>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
@ -388,7 +387,7 @@ cache_glob_lookup_fnmatch (const char *file_name,
|
||||||
mime_type = cache->buffer + mimetype_offset;
|
mime_type = cache->buffer + mimetype_offset;
|
||||||
|
|
||||||
/* FIXME: Not UTF-8 safe */
|
/* FIXME: Not UTF-8 safe */
|
||||||
if (fnmatch (ptr, file_name, 0) == 0) {
|
if (g_pattern_match_simple (ptr, file_name) != 0) {
|
||||||
mime_types[n].mime = mime_type;
|
mime_types[n].mime = mime_type;
|
||||||
mime_types[n].weight = weight;
|
mime_types[n].weight = weight;
|
||||||
n++;
|
n++;
|
||||||
|
|
|
@ -35,7 +35,8 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <fnmatch.h>
|
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
#ifndef FALSE
|
#ifndef FALSE
|
||||||
#define FALSE (0)
|
#define FALSE (0)
|
||||||
|
@ -362,7 +363,7 @@ _xdg_glob_hash_lookup_file_name (XdgGlobHash * glob_hash,
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
for (list = glob_hash->full_list; list && n < n_mime_types;
|
for (list = glob_hash->full_list; list && n < n_mime_types;
|
||||||
list = list->next) {
|
list = list->next) {
|
||||||
if (fnmatch ((const char *) list->data, file_name, 0) == 0) {
|
if (g_pattern_match_simple ((const char *) list->data, file_name) != 0) {
|
||||||
mimes[n].mime = list->mime_type;
|
mimes[n].mime = list->mime_type;
|
||||||
mimes[n].weight = list->weight;
|
mimes[n].weight = list->weight;
|
||||||
n++;
|
n++;
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <fnmatch.h>
|
|
||||||
|
|
||||||
#ifndef FALSE
|
#ifndef FALSE
|
||||||
#define FALSE (0)
|
#define FALSE (0)
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <fnmatch.h>
|
|
||||||
|
|
||||||
#ifndef FALSE
|
#ifndef FALSE
|
||||||
#define FALSE (0)
|
#define FALSE (0)
|
||||||
|
|
Loading…
Reference in a new issue