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
9e626537
Commit
9e626537
authored
Apr 21, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't add invalid keywords (empty match) to database.
parent
5bf4a7f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
src/data/keyword.cpp
src/data/keyword.cpp
+6
-2
src/data/keyword.hpp
src/data/keyword.hpp
+1
-1
No files found.
src/data/keyword.cpp
View file @
9e626537
...
...
@@ -170,7 +170,11 @@ void Keyword::prepare(const vector<KeywordParamP>& param_types, bool force) {
}
}
regex
+=
_
(
")"
);
if
(
!
matchRe
.
Compile
(
regex
,
wxRE_ADVANCED
))
{
if
(
matchRe
.
Compile
(
regex
,
wxRE_ADVANCED
))
{
// not valid if it matches "", that would make MSE hang
valid
=
!
matchRe
.
Matches
(
_
(
""
));
}
else
{
valid
=
false
;
throw
InternalError
(
_
(
"Error creating match regex"
));
}
}
...
...
@@ -254,7 +258,7 @@ void KeywordDatabase::add(const vector<KeywordP>& kws) {
}
void
KeywordDatabase
::
add
(
const
Keyword
&
kw
)
{
if
(
kw
.
match
.
empty
())
return
;
// can't handle empty keywords
if
(
kw
.
match
.
empty
()
||
!
kw
.
valid
)
return
;
// can't handle empty keywords
if
(
!
root
)
{
root
=
new
KeywordTrie
;
root
->
on_any_star
=
root
;
...
...
src/data/keyword.hpp
View file @
9e626537
...
...
@@ -65,7 +65,7 @@ class KeywordMode {
/// A keyword for a set or a game
class
Keyword
{
public:
Keyword
()
:
fixed
(
false
)
{}
Keyword
()
:
fixed
(
false
)
,
valid
(
false
)
{}
String
keyword
;
///< The keyword, only for human use
String
rules
;
///< Rules/explanation
...
...
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