Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
b6a7a7fa
Commit
b6a7a7fa
authored
Jun 02, 2008
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Case insensitive string compare inside installers
parent
6b548268
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
src/util/io/package_manager.cpp
src/util/io/package_manager.cpp
+1
-1
src/util/string.cpp
src/util/string.cpp
+11
-0
src/util/string.hpp
src/util/string.hpp
+5
-0
No files found.
src/util/io/package_manager.cpp
View file @
b6a7a7fa
...
@@ -348,7 +348,7 @@ bool PackageDirectory::actual_install(const InstallablePackage& package, const S
...
@@ -348,7 +348,7 @@ bool PackageDirectory::actual_install(const InstallablePackage& package, const S
const
Packaged
::
FileInfos
&
file_infos
=
installer
.
getFileInfos
();
const
Packaged
::
FileInfos
&
file_infos
=
installer
.
getFileInfos
();
for
(
Packaged
::
FileInfos
::
const_iterator
it
=
file_infos
.
begin
()
;
it
!=
file_infos
.
end
()
;
++
it
)
{
for
(
Packaged
::
FileInfos
::
const_iterator
it
=
file_infos
.
begin
()
;
it
!=
file_infos
.
end
()
;
++
it
)
{
String
file
=
it
->
first
;
String
file
=
it
->
first
;
if
(
!
is_substr
(
file
,
0
,
name
))
continue
;
// not the right package
if
(
!
is_substr
_i
(
file
,
0
,
name
))
continue
;
// not the right package
// correct filename
// correct filename
String
local_file
=
install_dir
+
file
.
substr
(
name
.
length
());
String
local_file
=
install_dir
+
file
.
substr
(
name
.
length
());
create_parent_dirs
(
local_file
);
create_parent_dirs
(
local_file
);
...
...
src/util/string.cpp
View file @
b6a7a7fa
...
@@ -370,6 +370,17 @@ bool is_substr(const String& str, size_t pos, const String& cmp) {
...
@@ -370,6 +370,17 @@ bool is_substr(const String& str, size_t pos, const String& cmp) {
return
is_substr
(
str
,
pos
,
cmp
.
c_str
());
return
is_substr
(
str
,
pos
,
cmp
.
c_str
());
}
}
bool
is_substr_i
(
const
String
&
str
,
size_t
pos
,
const
Char
*
cmp
)
{
for
(
String
::
const_iterator
it
=
str
.
begin
()
+
pos
;
*
cmp
&&
it
<
str
.
end
()
;
++
cmp
,
++
it
)
{
if
(
toLower
(
*
cmp
)
!=
toLower
(
*
it
))
return
false
;
}
return
*
cmp
==
_
(
'\0'
);
}
bool
is_substr_i
(
const
String
&
str
,
size_t
pos
,
const
String
&
cmp
)
{
return
is_substr_i
(
str
,
pos
,
cmp
.
c_str
());
}
bool
cannocial_name_compare
(
const
String
&
as
,
const
Char
*
b
)
{
bool
cannocial_name_compare
(
const
String
&
as
,
const
Char
*
b
)
{
const
Char
*
a
=
as
.
c_str
();
const
Char
*
a
=
as
.
c_str
();
while
(
true
)
{
while
(
true
)
{
...
...
src/util/string.hpp
View file @
b6a7a7fa
...
@@ -178,6 +178,11 @@ bool is_substr(const String& str, size_t pos, const Char* cmp);
...
@@ -178,6 +178,11 @@ bool is_substr(const String& str, size_t pos, const Char* cmp);
/// Return whether str contains the string cmp at position pos
/// Return whether str contains the string cmp at position pos
bool
is_substr
(
const
String
&
str
,
size_t
pos
,
const
String
&
cmp
);
bool
is_substr
(
const
String
&
str
,
size_t
pos
,
const
String
&
cmp
);
/// Return whether str contains the string cmp at position pos, case insensitive compare
bool
is_substr_i
(
const
String
&
str
,
size_t
pos
,
const
Char
*
cmp
);
/// Return whether str contains the string cmp at position pos, case insensitive compare
bool
is_substr_i
(
const
String
&
str
,
size_t
pos
,
const
String
&
cmp
);
/// Compare two strings for equality, b may contain '_' where a contains ' '
/// Compare two strings for equality, b may contain '_' where a contains ' '
bool
cannocial_name_compare
(
const
String
&
a
,
const
Char
*
b
);
bool
cannocial_name_compare
(
const
String
&
a
,
const
Char
*
b
);
...
...
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