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
3e989a90
Commit
3e989a90
authored
Jun 03, 2002
by
jani@rhols221.adsl.netsonic.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed two bugs in my_getopt.
parent
544f95c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
mysys/my_getopt.c
mysys/my_getopt.c
+8
-2
No files found.
mysys/my_getopt.c
View file @
3e989a90
...
...
@@ -68,7 +68,7 @@ int handle_options(int *argc, char ***argv,
{
uint
opt_found
,
argvpos
=
0
,
length
,
spec_len
,
i
;
my_bool
end_of_options
=
0
,
must_be_var
,
set_maximum_value
,
special_used
,
option_is_loose
;
option_is_loose
,
option_used
=
0
;
char
*
progname
=
*
(
*
argv
),
**
pos
,
*
optend
,
*
prev_found
;
const
struct
my_option
*
optp
;
int
error
;
...
...
@@ -84,6 +84,7 @@ int handle_options(int *argc, char ***argv,
if
(
cur_arg
[
0
]
==
'-'
&&
cur_arg
[
1
]
&&
!
end_of_options
)
/* must be opt */
{
char
*
argument
=
0
;
option_used
=
1
;
must_be_var
=
0
;
set_maximum_value
=
0
;
special_used
=
0
;
...
...
@@ -336,7 +337,6 @@ int handle_options(int *argc, char ***argv,
if
(
optp
->
var_type
==
GET_BOOL
&&
optp
->
arg_type
==
NO_ARG
)
{
*
((
my_bool
*
)
optp
->
value
)
=
(
my_bool
)
1
;
(
*
argc
)
--
;
continue
;
// For GET_BOOL get_one_option() shouldn't be called
}
else
if
(
optp
->
arg_type
==
REQUIRED_ARG
||
...
...
@@ -401,6 +401,12 @@ int handle_options(int *argc, char ***argv,
else
/* non-option found */
(
*
argv
)[
argvpos
++
]
=
cur_arg
;
}
/* Destroy the first, already handled option, so that programs that look
for arguments in 'argv', without checking 'argc', know when to stop.
Items in argv, before the destroyed one, are all non-option -arguments
to the program, yet to be (possibly) handled. */
if
(
option_used
)
(
*
argv
)[
argvpos
]
=
0
;
return
0
;
}
...
...
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