Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
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
Libraries
nghttp2
Commits
59c10ea4
Commit
59c10ea4
authored
Jan 12, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: Make the cost of suffix matched option 0
parent
37d41313
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/util.cc
src/util.cc
+4
-2
No files found.
src/util.cc
View file @
59c10ea4
...
@@ -326,8 +326,10 @@ void show_candidates(const char *unkopt, option *options)
...
@@ -326,8 +326,10 @@ void show_candidates(const char *unkopt, option *options)
}
}
auto
cands
=
std
::
vector
<
std
::
pair
<
int
,
const
char
*>>
();
auto
cands
=
std
::
vector
<
std
::
pair
<
int
,
const
char
*>>
();
for
(
size_t
i
=
0
;
options
[
i
].
name
!=
nullptr
;
++
i
)
{
for
(
size_t
i
=
0
;
options
[
i
].
name
!=
nullptr
;
++
i
)
{
// Use cost 0 for prefix match
// Use cost 0 for prefix or suffix match
if
(
istartsWith
(
options
[
i
].
name
,
unkopt
))
{
if
(
istartsWith
(
options
[
i
].
name
,
unkopt
)
||
iendsWith
(
options
[
i
].
name
,
options
[
i
].
name
+
strlen
(
options
[
i
].
name
),
unkopt
,
unkopt
+
strlen
(
unkopt
)))
{
cands
.
emplace_back
(
0
,
options
[
i
].
name
);
cands
.
emplace_back
(
0
,
options
[
i
].
name
);
continue
;
continue
;
}
}
...
...
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