MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Mats Kindahl Date:November 16 2010 11:08am
Subject:bzr commit into mysql-trunk branch (mats.kindahl:3350) Bug#58173
View as plain text  
#At file:///home/bzr/bugs/b57108-trunk-fixing/ based on revid:alexander.nozdrin@stripped

 3350 Mats Kindahl	2010-11-16 [merge]
      Merging patch for BUG#58173 into mysql-trunk-bugfixing

    modified:
      mysys/default.c
=== modified file 'mysys/default.c'
--- a/mysys/default.c	2010-11-10 11:48:00 +0000
+++ b/mysys/default.c	2010-11-16 11:07:17 +0000
@@ -68,6 +68,9 @@ const char *my_defaults_file=0;
 const char *my_defaults_group_suffix=0;
 const char *my_defaults_extra_file=0;
 
+static char my_defaults_file_buffer[FN_REFLEN];
+static char my_defaults_extra_file_buffer[FN_REFLEN];
+
 static my_bool defaults_already_read= FALSE;
 
 /* Which directories are searched for options (and in which order) */
@@ -152,22 +155,19 @@ static char *remove_end_comment(char *pt
  */
 
 static int
-fn_expand(const char *filename, const char **filename_var)
+fn_expand(const char *filename, char *result_buf)
 {
-  char dir[FN_REFLEN], buf[FN_REFLEN];
+  char dir[FN_REFLEN];
   const int flags= MY_UNPACK_FILENAME | MY_SAFE_PATH | MY_RELATIVE_PATH;
-  const char *result_path= NULL;
   DBUG_ENTER("fn_expand");
-  DBUG_PRINT("enter", ("filename: %s, buf: 0x%lx", filename, (unsigned long) buf));
+  DBUG_PRINT("enter", ("filename: %s, result_buf: 0x%lx",
+                       filename, (unsigned long) result_buf));
   if (my_getwd(dir, sizeof(dir), MYF(0)))
     DBUG_RETURN(3);
   DBUG_PRINT("debug", ("dir: %s", dir));
-  if (fn_format(buf, filename, dir, NULL, flags) == NULL ||
-      (result_path= my_strdup(buf, MYF(0))) == NULL)
+  if (fn_format(result_buf, filename, dir, NULL, flags) == NULL)
     DBUG_RETURN(2);
-  DBUG_PRINT("return", ("result: %s", result_path));
-  DBUG_ASSERT(result_path != NULL);
-  *filename_var= result_path;
+  DBUG_PRINT("return", ("result: %s", result_buf));
   DBUG_RETURN(0);
 }
 
@@ -224,16 +224,18 @@ int my_search_option_files(const char *c
 
   if (forced_extra_defaults && !defaults_already_read)
   {
-    int error= fn_expand(forced_extra_defaults, &my_defaults_extra_file);
+    int error= fn_expand(forced_extra_defaults, my_defaults_extra_file_buffer);
     if (error)
       DBUG_RETURN(error);
+    my_defaults_extra_file= my_defaults_extra_file_buffer;
   }
 
   if (forced_default_file && !defaults_already_read)
   {
-    int error= fn_expand(forced_default_file, &my_defaults_file);
+    int error= fn_expand(forced_default_file, my_defaults_file_buffer);
     if (error)
       DBUG_RETURN(error);
+    my_defaults_file= my_defaults_file_buffer;
   }
 
   defaults_already_read= TRUE;


Attachment: [text/bzr-bundle] bzr/mats.kindahl@oracle.com-20101116110717-0pwzyuyy7h3mou0y.bundle
Thread
bzr commit into mysql-trunk branch (mats.kindahl:3350) Bug#58173Mats Kindahl16 Nov