Merge with 4.0.16

This commit is contained in:
monty@narttu.mysql.fi 2003-10-07 15:42:26 +03:00
commit 6056cfadfc
167 changed files with 2874 additions and 6760 deletions

View file

@ -374,9 +374,20 @@ static int search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
char *value_end;
for (value++ ; my_isspace(&my_charset_latin1,*value); value++) ;
value_end=strend(value);
/*
We don't have to test for value_end >= value as we know there is
an '=' before
*/
for ( ; my_isspace(&my_charset_latin1,value_end[-1]) ; value_end--) ;
if (value_end < value) /* Empty string */
value_end=value;
/* remove quotes around argument */
if ((*value == '\"' || *value == '\'') && *value == value_end[-1])
{
value++;
value_end--;
}
if (!(tmp=alloc_root(alloc,(uint) (end-ptr)+3 +
(uint) (value_end-value)+1)))
goto err;
@ -384,6 +395,7 @@ static int search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
goto err;
ptr=strnmov(strmov(tmp,"--"),ptr,(uint) (end-ptr));
*ptr++= '=';
for ( ; value != value_end; value++)
{
if (*value == '\\' && value != value_end-1)
@ -404,6 +416,12 @@ static int search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
case 's':
*ptr++= ' '; /* space */
break;
case '\"':
*ptr++= '\"';
break;
case '\'':
*ptr++= '\'';
break;
case '\\':
*ptr++= '\\';
break;

View file

@ -54,19 +54,29 @@ uint dirname_part(my_string to, const char *name)
} /* dirname */
/*
Convert directory name to use under this system
If MSDOS converts '/' to '\'
If VMS converts '<' to '[' and '>' to ']'
Adds a FN_LIBCHAR to end if the result string if there isn't one
and the last isn't dev_char.
Copies data from 'from' until ASCII(0) for until from == from_end
If you want to use the whole 'from' string, just send NullS as the
last argument.
If the result string is larger than FN_REFLEN -1, then it's cut.
/*
Convert directory name to use under this system
Returns pointer to end \0
*/
SYNPOSIS
convert_dirname()
to Store result here
from Original filename
from_end Pointer at end of filename (normally end \0)
IMPLEMENTATION
If MSDOS converts '/' to '\'
If VMS converts '<' to '[' and '>' to ']'
Adds a FN_LIBCHAR to end if the result string if there isn't one
and the last isn't dev_char.
Copies data from 'from' until ASCII(0) for until from == from_end
If you want to use the whole 'from' string, just send NullS as the
last argument.
If the result string is larger than FN_REFLEN -1, then it's cut.
RETURN
Returns pointer to end \0 in to
*/
#ifndef FN_DEVCHAR
#define FN_DEVCHAR '\0' /* For easier code */