summaryrefslogtreecommitdiff
path: root/mysys/default.c
diff options
context:
space:
mode:
authormonty@narttu.mysql.fi <>2003-10-07 15:42:26 +0300
committermonty@narttu.mysql.fi <>2003-10-07 15:42:26 +0300
commit6056cfadfcb07cda12f6dc01ec9c1ab07067ac69 (patch)
treed89c080ef636608e316f1166b1628cd1d902deec /mysys/default.c
parent0091fa2e3266da6a17b0615a4696c25a4d36d664 (diff)
parent446d40e880c0e6ab6ac56b0082d4883ef5c7d467 (diff)
downloadmariadb-git-6056cfadfcb07cda12f6dc01ec9c1ab07067ac69.tar.gz
Merge with 4.0.16
Diffstat (limited to 'mysys/default.c')
-rw-r--r--mysys/default.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/mysys/default.c b/mysys/default.c
index 8bdf8d4f741..15eb358df22 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -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;