~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_getwd.c

  • Committer: Patrick Galbraith
  • Date: 2008-07-24 16:57:40 UTC
  • mto: (202.2.4 rename-mysql-to-drizzle)
  • mto: This revision was merged to the branch mainline in revision 212.
  • Revision ID: patg@ishvara-20080724165740-x58yw6zs6d9o17lf
Most everything working with client rename
mysqlslap test still fails... can't connect to the server

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
23
23
#include <sys/param.h>
24
24
#endif
25
 
#include <drizzled/util/test.h>
26
25
 
27
26
/* Gets current working directory in buff.
28
27
 
45
44
  char * pos;
46
45
 
47
46
  if (curr_dir[0])                              /* Current pos is saved here */
48
 
    strmake(buf,&curr_dir[0],size-1);
 
47
    VOID(strmake(buf,&curr_dir[0],size-1));
49
48
  else
50
49
  {
51
50
#if defined(HAVE_GETCWD)
72
71
#else
73
72
#error "No way to get current directory"
74
73
#endif
75
 
    if (*((pos= strchr(buf, '\0'))-1) != FN_LIBCHAR)  /* End with FN_LIBCHAR */
 
74
    if (*((pos=strend(buf))-1) != FN_LIBCHAR)  /* End with FN_LIBCHAR */
76
75
    {
77
76
      pos[0]= FN_LIBCHAR;
78
77
      pos[1]=0;
89
88
{
90
89
  int res;
91
90
  size_t length;
92
 
  const char *start;
93
 
  char *pos;
 
91
  char *start, *pos;
94
92
#if defined(VMS)
95
93
  char buff[FN_REFLEN];
96
94
#endif
97
95
 
98
 
  start= dir;
 
96
  start=(char *) dir;
99
97
  if (! dir[0] || (dir[0] == FN_LIBCHAR && dir[1] == 0))
100
98
    dir=FN_ROOTDIR;
101
99
#ifdef VMS
102
100
  {
103
 
    pos=my_stpcpy(buff,dir);
 
101
    pos=strmov(buff,dir);
104
102
    if (pos[-1] != FN_LIBCHAR)
105
103
    {
106
104
      pos[0]=FN_LIBCHAR;                /* Mark as directory */
110
108
    dir=buff;
111
109
  }
112
110
#endif /* VMS */
113
 
  if ((res=chdir(dir)) != 0)
 
111
  if ((res=chdir((char*) dir)) != 0)
114
112
  {
115
113
    my_errno=errno;
116
114
    if (MyFlags & MY_WME)
142
140
int test_if_hard_path(register const char *dir_name)
143
141
{
144
142
  if (dir_name[0] == FN_HOMELIB && dir_name[1] == FN_LIBCHAR)
145
 
    return (home_dir != NULL && test_if_hard_path(home_dir));
 
143
    return (home_dir != NullS && test_if_hard_path(home_dir));
146
144
  if (dir_name[0] == FN_LIBCHAR)
147
145
    return (true);
148
146
#ifdef FN_DEVCHAR