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
3a818b6d
Commit
3a818b6d
authored
Feb 17, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SongFilter: disable g_utf8_casefold() without GLib
Temporary hack for the experimental no-GLib build.
parent
1709ab68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
SongFilter.cxx
src/SongFilter.cxx
+14
-0
No files found.
src/SongFilter.cxx
View file @
3a818b6d
...
...
@@ -26,7 +26,9 @@
#include "util/ASCII.hxx"
#include "util/UriUtil.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <assert.h>
#include <string.h>
...
...
@@ -56,10 +58,15 @@ gcc_pure
static
std
::
string
CaseFold
(
const
char
*
p
)
{
#ifdef HAVE_GLIB
char
*
q
=
g_utf8_casefold
(
p
,
-
1
);
std
::
string
result
(
q
);
g_free
(
q
);
return
result
;
#else
// TODO: implement without GLib
return
p
;
#endif
}
gcc_pure
...
...
@@ -83,9 +90,16 @@ SongFilter::Item::StringMatch(const char *s) const
assert
(
s
!=
nullptr
);
if
(
fold_case
)
{
#ifdef HAVE_GLIB
char
*
p
=
g_utf8_casefold
(
s
,
-
1
);
#else
// TODO: implement without GLib
const
char
*
p
=
s
;
#endif
const
bool
result
=
strstr
(
p
,
value
.
c_str
())
!=
NULL
;
#ifdef HAVE_GLIB
g_free
(
p
);
#endif
return
result
;
}
else
{
return
s
==
value
;
...
...
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