mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +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 <assert.h>
|
||||
#include <string.h>
|
||||
#include <fnmatch.h>
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE (0)
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <fnmatch.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
@ -388,7 +387,7 @@ cache_glob_lookup_fnmatch (const char *file_name,
|
|||
mime_type = cache->buffer + mimetype_offset;
|
||||
|
||||
/* 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].weight = weight;
|
||||
n++;
|
||||
|
|
|
@ -35,7 +35,8 @@
|
|||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <fnmatch.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE (0)
|
||||
|
@ -362,7 +363,7 @@ _xdg_glob_hash_lookup_file_name (XdgGlobHash * glob_hash,
|
|||
if (n == 0) {
|
||||
for (list = glob_hash->full_list; list && n < n_mime_types;
|
||||
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].weight = list->weight;
|
||||
n++;
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <fnmatch.h>
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE (0)
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <fnmatch.h>
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE (0)
|
||||
|
|
Loading…
Reference in a new issue