1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

more refinement of IM patch to fix Windows pathnames with spaces

This commit is contained in:
reggie@fedora.(none)
2005-11-02 06:51:44 -06:00
parent 27e8da7985
commit e3ff45d61e
2 changed files with 8 additions and 9 deletions

View File

@ -334,12 +334,13 @@ int Instance_options::complete_initialization(const char *default_path,
uint instance_type)
{
const char *tmp;
char* end;
if (!mysqld_path && !(mysqld_path= strdup_root(&alloc, default_path)))
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= convert_dirname((char*)mysqld_path, mysqld_path, NullS);
end[-1]= 0;
mysqld_path_len= strlen(mysqld_path);

View File

@ -33,7 +33,7 @@ void trim_space(const char **text, uint *word_len)
int len= strlen(start);
const char* end= start + len - 1;
while (end > start && (*end == ' ' || *end == '\r' || *end == '\n'))
while (end > start && my_isspace(&my_charset_latin1, *end))
end--;
*word_len= (end - start)+1;
}
@ -96,16 +96,14 @@ int parse_output_and_get_value(const char *command, const char *word,
linebuf[sizeof(linebuf) - 1]= '\0'; /* safety */
/*
Get the word, which might contain non-alphanumeric characters. (Usually
these are '/', '-' and '.' in the path expressions and filenames)
Compare the start of our line with the word(s) we are looking for.
*/
if (!strncmp(word, linep, wordlen))
{
/*
If we have found the word, return the next one (this is usually
an option value) or the whole line (if flag)
If we have found our word(s), then move linep past the word(s)
*/
linep+= wordlen; /* swallow the previous one */
linep+= wordlen;
if (flag & GET_VALUE)
{
trim_space((const char**) &linep, &found_word_len);