summaryrefslogtreecommitdiff
path: root/mysys/default.c
diff options
context:
space:
mode:
authormonty@narttu.mysql.fi <>2003-09-23 17:06:44 +0300
committermonty@narttu.mysql.fi <>2003-09-23 17:06:44 +0300
commit45a41e85e3d6c94be8690d2431fb4ed96da03c06 (patch)
tree3eac2fbc00ec3335470f74d59174520b731a9e75 /mysys/default.c
parent5f164e2f70760a63065c7b0e247b5b3924aa3f54 (diff)
downloadmariadb-git-45a41e85e3d6c94be8690d2431fb4ed96da03c06.tar.gz
Code cleanup of new patches
Diffstat (limited to 'mysys/default.c')
-rw-r--r--mysys/default.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/mysys/default.c b/mysys/default.c
index 0318efeb448..3c9f9c823a1 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -375,9 +375,20 @@ static int search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
char *value_end;
for (value++ ; isspace(*value); value++) ;
value_end=strend(value);
+ /*
+ We don't have to test for value_end >= value as we know there is
+ an '=' before
+ */
for ( ; isspace(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;
@@ -385,10 +396,9 @@ 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 == '\'')
- continue;
if (*value == '\\' && value != value_end-1)
{
switch(*++value) {