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
828f5f83
Commit
828f5f83
authored
Sep 20, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/icu/CaseFold: disable broken strxfrm() callback
parent
1295a127
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
17 deletions
+10
-17
CaseFold.cxx
src/lib/icu/CaseFold.cxx
+6
-15
CaseFold.hxx
src/lib/icu/CaseFold.hxx
+4
-2
No files found.
src/lib/icu/CaseFold.cxx
View file @
828f5f83
...
@@ -19,6 +19,9 @@
...
@@ -19,6 +19,9 @@
#include "config.h"
#include "config.h"
#include "CaseFold.hxx"
#include "CaseFold.hxx"
#ifdef HAVE_ICU_CASE_FOLD
#include "util/AllocatedString.hxx"
#include "util/AllocatedString.hxx"
#ifdef HAVE_ICU
#ifdef HAVE_ICU
...
@@ -90,22 +93,10 @@ try {
...
@@ -90,22 +93,10 @@ try {
return
WideCharToMultiByte
(
CP_UTF8
,
buffer
.
get
());
return
WideCharToMultiByte
(
CP_UTF8
,
buffer
.
get
());
#else
#else
size_t
size
=
strlen
(
src
)
+
1
;
#error not implemented
std
::
unique_ptr
<
char
[]
>
buffer
(
new
char
[
size
]);
size_t
nbytes
=
strxfrm
(
buffer
.
get
(),
src
,
size
);
if
(
nbytes
>=
size
)
{
/* buffer too small - reallocate and try again */
buffer
.
reset
();
size
=
nbytes
+
1
;
buffer
.
reset
(
new
char
[
size
]);
nbytes
=
strxfrm
(
buffer
.
get
(),
src
,
size
);
}
assert
(
nbytes
<
size
);
assert
(
buffer
[
nbytes
]
==
0
);
return
AllocatedString
<>::
Donate
(
buffer
.
release
());
#endif
#endif
}
catch
(
const
std
::
runtime_error
&
)
{
}
catch
(
const
std
::
runtime_error
&
)
{
return
AllocatedString
<>::
Duplicate
(
src
);
return
AllocatedString
<>::
Duplicate
(
src
);
}
}
#endif
/* HAVE_ICU_CASE_FOLD */
src/lib/icu/CaseFold.hxx
View file @
828f5f83
...
@@ -21,11 +21,11 @@
...
@@ -21,11 +21,11 @@
#define MPD_ICU_CASE_FOLD_HXX
#define MPD_ICU_CASE_FOLD_HXX
#include "check.h"
#include "check.h"
#include "Compiler.h"
#if defined(HAVE_ICU) || defined(_WIN32)
#if defined(HAVE_ICU) || defined(_WIN32)
#define HAVE_ICU_CASE_FOLD
#define HAVE_ICU_CASE_FOLD
#endif
#include "Compiler.h"
template
<
typename
T
>
class
AllocatedString
;
template
<
typename
T
>
class
AllocatedString
;
...
@@ -34,3 +34,5 @@ AllocatedString<char>
...
@@ -34,3 +34,5 @@ AllocatedString<char>
IcuCaseFold
(
const
char
*
src
)
noexcept
;
IcuCaseFold
(
const
char
*
src
)
noexcept
;
#endif
#endif
#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