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
c9d76b51
Commit
c9d76b51
authored
May 14, 2003
by
jani@hynda.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a bug with having comments after options in config files.
Bug ID: 235
parent
b9f09fc5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
2 deletions
+28
-2
mysys/default.c
mysys/default.c
+28
-2
No files found.
mysys/default.c
View file @
c9d76b51
...
...
@@ -72,6 +72,7 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args,MEM_ROOT *alloc,
const
char
*
dir
,
const
char
*
config_file
,
const
char
*
ext
,
TYPELIB
*
group
);
static
char
*
remove_end_comment
(
char
*
ptr
);
void
load_defaults
(
const
char
*
conf_file
,
const
char
**
groups
,
int
*
argc
,
char
***
argv
)
...
...
@@ -297,9 +298,11 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
}
if
(
!
read_values
)
continue
;
if
(
!
(
end
=
value
=
strchr
(
ptr
,
'='
)))
end
=
strend
(
ptr
);
/* Option without argument */
end
=
remove_end_comment
(
ptr
);
if
((
value
=
strchr
(
ptr
,
'='
)))
end
=
value
;
/* Option without argument */
for
(
;
isspace
(
end
[
-
1
])
;
end
--
)
;
if
(
!
value
)
{
if
(
!
(
tmp
=
alloc_root
(
alloc
,(
uint
)
(
end
-
ptr
)
+
3
)))
...
...
@@ -368,6 +371,29 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
}
static
char
*
remove_end_comment
(
char
*
ptr
)
{
char
quote
=
0
;
for
(;
*
ptr
;
ptr
++
)
{
if
(
*
ptr
==
'\''
||
*
ptr
==
'\"'
)
{
if
(
!
quote
)
quote
=
*
ptr
;
else
if
(
quote
==
*
ptr
)
quote
=
0
;
}
if
(
!
quote
&&
*
ptr
==
'#'
)
/* We are not inside a comment */
{
*
ptr
=
0
;
return
ptr
;
}
}
return
ptr
;
}
void
print_defaults
(
const
char
*
conf_file
,
const
char
**
groups
)
{
#ifdef __WIN__
...
...
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