~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_lib.c

  • Committer: Brian Aker
  • Date: 2008-09-04 19:31:00 UTC
  • Revision ID: brian@tangent.org-20080904193100-l849hgghfy4urj43
Changing default character set from this point on.

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