mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
improved previous changeset per JimW's review
server-tools/instance-manager/instance_options.cc: fixed to coding guidelines server-tools/instance-manager/parse_output.cc: removed tabs and added call to trim_space
This commit is contained in:
@ -340,7 +340,7 @@ int Instance_options::complete_initialization(const char *default_path,
|
|||||||
|
|
||||||
// it's safe to cast this to char* since this is a buffer we are allocating
|
// 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);
|
char* end= convert_dirname((char*)mysqld_path, mysqld_path, NullS);
|
||||||
end[-1] = 0;
|
end[-1]= 0;
|
||||||
|
|
||||||
mysqld_path_len= strlen(mysqld_path);
|
mysqld_path_len= strlen(mysqld_path);
|
||||||
|
|
||||||
|
@ -26,16 +26,16 @@
|
|||||||
|
|
||||||
void trim_space(const char **text, uint *word_len)
|
void trim_space(const char **text, uint *word_len)
|
||||||
{
|
{
|
||||||
const char* start = *text;
|
const char* start = *text;
|
||||||
while (*start != 0 && *start == ' ')
|
while (*start != 0 && *start == ' ')
|
||||||
start++;
|
start++;
|
||||||
*text = start;
|
*text= start;
|
||||||
|
|
||||||
int len= strlen(start);
|
int len= strlen(start);
|
||||||
const char* end= start + len - 1;
|
const char* end= start + len - 1;
|
||||||
while (end > start && (*end == ' ' || *end == '\r' || *end == '\n'))
|
while (end > start && (*end == ' ' || *end == '\r' || *end == '\n'))
|
||||||
end--;
|
end--;
|
||||||
*word_len= (end - start)+1;
|
*word_len= (end - start)+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -108,7 +108,7 @@ int parse_output_and_get_value(const char *command, const char *word,
|
|||||||
linep+= wordlen; /* 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);
|
trim_space((const char**) &linep, &found_word_len);
|
||||||
if (input_buffer_len <= found_word_len)
|
if (input_buffer_len <= found_word_len)
|
||||||
goto err;
|
goto err;
|
||||||
strmake(result, linep, found_word_len);
|
strmake(result, linep, found_word_len);
|
||||||
|
Reference in New Issue
Block a user