~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_getwd.c

Moved base64.h to mysys.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
/* my_setwd() and my_getwd() works with intern_filenames !! */
17
17
 
18
18
#include "mysys_priv.h"
19
 
#include <mystrings/m_string.h>
 
19
#include <m_string.h>
20
20
#include "mysys_err.h"
21
21
#include "my_static.h"
22
22
#ifdef HAVE_GETWD
44
44
  char * pos;
45
45
 
46
46
  if (curr_dir[0])                              /* Current pos is saved here */
47
 
    strmake(buf,&curr_dir[0],size-1);
 
47
    VOID(strmake(buf,&curr_dir[0],size-1));
48
48
  else
49
49
  {
50
50
#if defined(HAVE_GETCWD)
71
71
#else
72
72
#error "No way to get current directory"
73
73
#endif
74
 
    if (*((pos= strchr(buf, '\0'))-1) != FN_LIBCHAR)  /* End with FN_LIBCHAR */
 
74
    if (*((pos=strend(buf))-1) != FN_LIBCHAR)  /* End with FN_LIBCHAR */
75
75
    {
76
76
      pos[0]= FN_LIBCHAR;
77
77
      pos[1]=0;
88
88
{
89
89
  int res;
90
90
  size_t length;
91
 
  const char *start;
92
 
  char *pos;
 
91
  char *start, *pos;
93
92
#if defined(VMS)
94
93
  char buff[FN_REFLEN];
95
94
#endif
96
95
 
97
 
  start= dir;
 
96
  start=(char *) dir;
98
97
  if (! dir[0] || (dir[0] == FN_LIBCHAR && dir[1] == 0))
99
98
    dir=FN_ROOTDIR;
100
99
#ifdef VMS
101
100
  {
102
 
    pos=my_stpcpy(buff,dir);
 
101
    pos=strmov(buff,dir);
103
102
    if (pos[-1] != FN_LIBCHAR)
104
103
    {
105
104
      pos[0]=FN_LIBCHAR;                /* Mark as directory */
109
108
    dir=buff;
110
109
  }
111
110
#endif /* VMS */
112
 
  if ((res=chdir(dir)) != 0)
 
111
  if ((res=chdir((char*) dir)) != 0)
113
112
  {
114
113
    my_errno=errno;
115
114
    if (MyFlags & MY_WME)
141
140
int test_if_hard_path(register const char *dir_name)
142
141
{
143
142
  if (dir_name[0] == FN_HOMELIB && dir_name[1] == FN_LIBCHAR)
144
 
    return (home_dir != NULL && test_if_hard_path(home_dir));
 
143
    return (home_dir != NullS && test_if_hard_path(home_dir));
145
144
  if (dir_name[0] == FN_LIBCHAR)
146
145
    return (true);
147
146
#ifdef FN_DEVCHAR