Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
2aa54c53
Commit
2aa54c53
authored
Jun 22, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/Glob: use PathMatchSpec() on Windows
parent
bc854250
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
Makefile.am
Makefile.am
+5
-0
Glob.hxx
src/fs/Glob.hxx
+8
-2
No files found.
Makefile.am
View file @
2aa54c53
...
...
@@ -578,6 +578,11 @@ libfs_a_SOURCES += \
FS_LIBS
+=
$(ZLIB_LIBS)
endif
if
HAVE_WINDOWS
# for PathMatchSpec()
FS_LIBS
+=
-lshlwapi
endif
# Storage library
SMBCLIENT_SOURCES
=
\
...
...
src/fs/Glob.hxx
View file @
2aa54c53
...
...
@@ -26,6 +26,10 @@
#define HAVE_CLASS_GLOB
#include <string>
#include <fnmatch.h>
#elif defined(WIN32)
#define HAVE_CLASS_GLOB
#include <string>
#include <shlwapi.h>
#elif defined(HAVE_GLIB)
#define HAVE_CLASS_GLOB
#include <glib.h>
...
...
@@ -39,14 +43,14 @@
* (asterisk and question mark).
*/
class
Glob
{
#if
def HAVE_FNMATCH
#if
defined(HAVE_FNMATCH) || defined(WIN32)
std
::
string
pattern
;
#else
GPatternSpec
*
pattern
;
#endif
public
:
#if
def HAVE_FNMATCH
#if
defined(HAVE_FNMATCH) || defined(WIN32)
explicit
Glob
(
const
char
*
_pattern
)
:
pattern
(
_pattern
)
{}
...
...
@@ -70,6 +74,8 @@ public:
bool
Check
(
const
char
*
name_fs
)
const
{
#ifdef HAVE_FNMATCH
return
fnmatch
(
pattern
.
c_str
(),
name_fs
,
0
)
==
0
;
#elif defined(WIN32)
return
PathMatchSpecA
(
name_fs
,
pattern
.
c_str
());
#else
return
g_pattern_match_string
(
pattern
,
name_fs
);
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment