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
53089ec4
Commit
53089ec4
authored
Oct 31, 2005
by
reggie@fedora.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some issues with IM and long pathnames (with spaces)
parent
1137a376
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
server-tools/instance-manager/instance_options.cc
server-tools/instance-manager/instance_options.cc
+6
-4
server-tools/instance-manager/parse_output.cc
server-tools/instance-manager/parse_output.cc
+15
-2
No files found.
server-tools/instance-manager/instance_options.cc
View file @
53089ec4
...
@@ -47,14 +47,12 @@ static inline int create_mysqld_command(Buffer *buf,
...
@@ -47,14 +47,12 @@ static inline int create_mysqld_command(Buffer *buf,
if
(
buf
->
get_size
())
/* malloc succeeded */
if
(
buf
->
get_size
())
/* malloc succeeded */
{
{
#ifdef __WIN__
#ifdef __WIN__
buf
->
append
(
position
,
"
\"
"
,
1
);
buf
->
append
(
position
++
,
"
\"
"
,
1
);
position
++
;
#endif
#endif
buf
->
append
(
position
,
mysqld_path_str
,
mysqld_path_len
);
buf
->
append
(
position
,
mysqld_path_str
,
mysqld_path_len
);
position
+=
mysqld_path_len
;
position
+=
mysqld_path_len
;
#ifdef __WIN__
#ifdef __WIN__
buf
->
append
(
position
,
"
\"
"
,
1
);
buf
->
append
(
position
++
,
"
\"
"
,
1
);
position
++
;
#endif
#endif
/* here the '\0' character is copied from the option string */
/* here the '\0' character is copied from the option string */
buf
->
append
(
position
,
option
,
option_len
);
buf
->
append
(
position
,
option
,
option_len
);
...
@@ -340,6 +338,10 @@ int Instance_options::complete_initialization(const char *default_path,
...
@@ -340,6 +338,10 @@ int Instance_options::complete_initialization(const char *default_path,
if
(
!
mysqld_path
&&
!
(
mysqld_path
=
strdup_root
(
&
alloc
,
default_path
)))
if
(
!
mysqld_path
&&
!
(
mysqld_path
=
strdup_root
(
&
alloc
,
default_path
)))
goto
err
;
goto
err
;
// it's safe to cast this to char* since this is a buffer we are allocating
char
*
end
=
convert_dirname
((
char
*
)
mysqld_path
,
mysqld_path
,
NullS
);
end
[
-
1
]
=
0
;
mysqld_path_len
=
strlen
(
mysqld_path
);
mysqld_path_len
=
strlen
(
mysqld_path
);
if
(
mysqld_port
)
if
(
mysqld_port
)
...
...
server-tools/instance-manager/parse_output.cc
View file @
53089ec4
...
@@ -24,6 +24,20 @@
...
@@ -24,6 +24,20 @@
#include "portability.h"
#include "portability.h"
void
trim_space
(
const
char
**
text
,
uint
*
word_len
)
{
const
char
*
start
=
*
text
;
while
(
*
start
!=
0
&&
*
start
==
' '
)
start
++
;
*
text
=
start
;
int
len
=
strlen
(
start
);
const
char
*
end
=
start
+
len
-
1
;
while
(
end
>
start
&&
(
*
end
==
' '
||
*
end
==
'\r'
||
*
end
==
'\n'
))
end
--
;
*
word_len
=
(
end
-
start
)
+
1
;
}
/*
/*
Parse output of the given command
Parse output of the given command
...
@@ -85,14 +99,13 @@ int parse_output_and_get_value(const char *command, const char *word,
...
@@ -85,14 +99,13 @@ int parse_output_and_get_value(const char *command, const char *word,
Get the word, which might contain non-alphanumeric characters. (Usually
Get the word, which might contain non-alphanumeric characters. (Usually
these are '/', '-' and '.' in the path expressions and filenames)
these are '/', '-' and '.' in the path expressions and filenames)
*/
*/
get_word
((
const
char
**
)
&
linep
,
&
found_word_len
,
NONSPACE
);
if
(
!
strncmp
(
word
,
linep
,
wordlen
))
if
(
!
strncmp
(
word
,
linep
,
wordlen
))
{
{
/*
/*
If we have found the word, return the next one (this is usually
If we have found the word, return the next one (this is usually
an option value) or the whole line (if flag)
an option value) or the whole line (if flag)
*/
*/
linep
+=
found_word_len
;
/* swallow the previous one */
linep
+=
wordlen
;
/* swallow the previous one */
if
(
flag
&
GET_VALUE
)
if
(
flag
&
GET_VALUE
)
{
{
get_word
((
const
char
**
)
&
linep
,
&
found_word_len
,
NONSPACE
);
get_word
((
const
char
**
)
&
linep
,
&
found_word_len
,
NONSPACE
);
...
...
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