Commit 27e8da79 authored by reggie@fedora.(none)'s avatar reggie@fedora.(none)

improved previous changeset per JimW's review

parent 53089ec4
......@@ -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
char* end= convert_dirname((char*)mysqld_path, mysqld_path, NullS);
end[-1] = 0;
end[-1]= 0;
mysqld_path_len= strlen(mysqld_path);
......
......@@ -26,16 +26,16 @@
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;
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;
}
/*
......@@ -108,7 +108,7 @@ int parse_output_and_get_value(const char *command, const char *word,
linep+= wordlen; /* swallow the previous one */
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)
goto err;
strmake(result, linep, found_word_len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment