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
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
nexedi
MariaDB
Commits
6d59a131
Commit
6d59a131
authored
Aug 26, 2010
by
Marc Alff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented code review comments
parent
4c2de881
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
28 deletions
+11
-28
mysys/my_getopt.c
mysys/my_getopt.c
+11
-28
No files found.
mysys/my_getopt.c
View file @
6d59a131
...
...
@@ -511,35 +511,18 @@ int handle_options(int *argc, char ***argv,
{
/*
We are currently parsing a single argv[] argument
of the form "-XYZ", and parsing is done in multiple phases.
One or the argument found is not an option.
*/
if
(
optend
==
cur_arg
)
{
/*
The first argument, "-X", is not an option
In this case, the entire argument "-XYZ" is rejected
from this phase, and preserved as is for later parsing.
*/
(
*
argv
)[
argvpos
++
]
=
*
pos
;
}
else
{
/*
We are in the middle of an "-XYZ" string already,
"-X" has already been parsed, and "Y" (pointed by optend)
is not an option.
of the form "-XYZ".
One or the argument found (say Y) is not an option.
Hack the string "-XYZ" to make a "-YZ" substring in it,
and push that to the next parsing phase
.
and push that to the output as an unrecognized parameter
.
*/
DBUG_ASSERT
(
optend
>
*
pos
);
DBUG_ASSERT
(
optend
>
cur_arg
);
DBUG_ASSERT
(
optend
>=
cur_arg
);
DBUG_ASSERT
(
optend
<=
*
pos
+
strlen
(
*
pos
));
DBUG_ASSERT
(
*
optend
);
optend
--
;
optend
[
0
]
=
'-'
;
/* replace 'X
' by '-' */
optend
[
0
]
=
'-'
;
/* replace 'X' or '-
' by '-' */
(
*
argv
)[
argvpos
++
]
=
optend
;
}
/*
Do not continue to parse at the current "-XYZ" argument,
skip to the next argv[] argument instead.
...
...
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