~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/mf_tempdir.c

  • Committer: Monty Taylor
  • Date: 2008-08-02 01:03:15 UTC
  • mto: (236.1.42 codestyle)
  • mto: This revision was merged to the branch mainline in revision 261.
  • Revision ID: monty@inaugust.com-20080802010315-65h5938pymg9d99z
Moved m4 macros to top-level m4 dir, per GNU standards (and where gettext wanted it :)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
22
22
{
23
 
  const char *end;
24
 
  char *copy;
 
23
  char *end, *copy;
25
24
  char buff[FN_REFLEN];
26
25
 
27
26
  pthread_mutex_init(&tmpdir->mutex, MY_MUTEX_INIT_FAST);
34
33
    if (!pathlist || !pathlist[0])
35
34
      pathlist=(char*) P_tmpdir;
36
35
  }
37
 
  do {
 
36
  do
 
37
  {
38
38
    uint length;
39
 
    end= strrchr(pathlist, DELIM);
40
 
    if (end == NULL)
41
 
      end= pathlist+strlen(pathlist);
 
39
    end=strcend(pathlist, DELIM);
42
40
    strmake(buff, pathlist, (uint) (end-pathlist));
43
41
    length= cleanup_dirname(buff, buff);
44
42
    if (!(copy= my_strndup(buff, length, MYF(MY_WME))) ||
45
43
        insert_dynamic(&tmpdir->full_list, (uchar*) &copy))
46
44
      return(true);
47
45
    pathlist=end+1;
48
 
  } while (*end != '\0');
 
46
  }
 
47
  while (*end);
49
48
  freeze_size(&tmpdir->full_list);
50
49
  tmpdir->list=(char **)tmpdir->full_list.buffer;
51
50
  tmpdir->max=tmpdir->full_list.elements-1;