Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
0a1d7d64
Commit
0a1d7d64
authored
Jun 30, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made check for structured option handling more robust and faster.
Earlier it could have failed in some special cases.
parent
b871e549
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
mysys/my_getopt.c
mysys/my_getopt.c
+8
-6
No files found.
mysys/my_getopt.c
View file @
0a1d7d64
...
...
@@ -458,17 +458,19 @@ int handle_options(int *argc, char ***argv,
static
char
*
check_struct_option
(
char
*
cur_arg
,
char
*
key_name
)
{
char
*
ptr
,
*
ptr2
;
char
*
ptr
,
*
end
;
ptr
=
strcend
(
cur_arg
,
'.'
);
ptr2
=
strcend
(
cur_arg
,
'='
);
ptr
=
strcend
(
cur_arg
+
1
,
'.'
);
// Skip the first character
end
=
strcend
(
cur_arg
,
'='
);
/*
Minimum length for a struct option is 3 (--a.b)
If the (first) dot is after an equal sign, then it is part
If the first dot is after an equal sign, then it is part
of a variable value and the option is not a struct option.
Also, if the last character in the string before the ending
NULL, or the character right before equal sign is the first
dot found, the option is not a struct option.
*/
if
(
strlen
(
ptr
)
>=
3
&&
ptr2
-
ptr
>
0
)
if
(
end
-
ptr
>
1
)
{
uint
len
=
ptr
-
cur_arg
;
strnmov
(
key_name
,
cur_arg
,
len
);
...
...
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