~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_lib.c

  • Committer: Brian Aker
  • Date: 2008-11-04 15:39:09 UTC
  • mfrom: (575.1.2 devel)
  • Revision ID: brian@tangent.org-20081104153909-c72hn65udxs1ccal
Merge of Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include        "mysys_err.h"
23
23
#if defined(HAVE_DIRENT_H)
24
24
# include <dirent.h>
25
 
# define NAMLEN(dirent) strlen((dirent)->d_name)
26
25
#else
27
26
# define dirent direct
28
 
# define NAMLEN(dirent) (dirent)->d_namlen
29
27
# if defined(HAVE_SYS_NDIR_H)
30
28
#  include <sys/ndir.h>
31
29
# endif
66
64
                                    ALIGN_SIZE(sizeof(MY_DIR))));
67
65
    free_root((MEM_ROOT*)((char*)buffer + ALIGN_SIZE(sizeof(MY_DIR)) + 
68
66
                          ALIGN_SIZE(sizeof(DYNAMIC_ARRAY))), MYF(0));
69
 
    my_free((uchar*) buffer,MYF(0));
 
67
    free((unsigned char*) buffer);
70
68
  }
71
69
  return;
72
70
} /* my_dirend */
110
108
  if (my_init_dynamic_array(dir_entries_storage, sizeof(FILEINFO),
111
109
                            ENTRIES_START_SIZE, ENTRIES_INCREMENT))
112
110
  {
113
 
    my_free((uchar*) buffer,MYF(0));
 
111
    free((unsigned char*) buffer);
114
112
    goto error;
115
113
  }
116
114
  init_alloc_root(names_storage, NAMES_START_SIZE, NAMES_START_SIZE);
134
132
        goto error;
135
133
      
136
134
      memset(finfo.mystat, 0, sizeof(struct stat));
137
 
      VOID(stpcpy(tmp_file,dp->d_name));
138
 
      VOID(stat(tmp_path, finfo.mystat));
 
135
      my_stpcpy(tmp_file,dp->d_name);
 
136
      stat(tmp_path, finfo.mystat);
139
137
      if (!(finfo.mystat->st_mode & S_IREAD))
140
138
        continue;
141
139
    }
142
140
    else
143
141
      finfo.mystat= NULL;
144
142
 
145
 
    if (push_dynamic(dir_entries_storage, (uchar*)&finfo))
 
143
    if (push_dynamic(dir_entries_storage, (unsigned char*)&finfo))
146
144
      goto error;
147
145
  }
148
146
 
190
188
 
191
189
  if (src[0] == 0)
192
190
    src= (char*) ".";                           /* Use empty as current */
193
 
  end=stpcpy(dst, src);
 
191
  end=my_stpcpy(dst, src);
194
192
  if (end[-1] != FN_LIBCHAR)
195
193
  {
196
194
    end[0]=FN_LIBCHAR;                          /* Add last '/' */