~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/mf_loadpath.cc

  • Committer: Brian Aker
  • Date: 2010-02-07 01:33:54 UTC
  • Revision ID: brian@gaz-20100207013354-d2pg1n68u5c09pgo
Remove giant include header to its own file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
 
#include "mysys_priv.h"
17
 
#include <mystrings/m_string.h>
 
16
#include "config.h"
 
17
 
 
18
#include "drizzled/internal/my_sys.h"
 
19
#include "drizzled/internal/m_string.h"
 
20
 
 
21
namespace drizzled
 
22
{
 
23
namespace internal
 
24
{
18
25
 
19
26
        /* Returns full load-path for a file. to may be = path */
20
27
        /* if path is a hard-path return path */
31
38
 
32
39
  if ((path[0] == FN_HOMELIB && path[1] == FN_LIBCHAR) ||
33
40
      test_if_hard_path(path))
34
 
    VOID(stpcpy(buff,path));
 
41
    strcpy(buff,path);
35
42
  else if ((is_cur=(path[0] == FN_CURLIB && path[1] == FN_LIBCHAR)) ||
36
 
           (is_prefix(path,FN_PARENTDIR)) ||
 
43
           (strncmp(path,FN_PARENTDIR, strlen(FN_PARENTDIR)) == 0) ||
37
44
           ! own_path_prefix)
38
45
  {
39
46
    if (is_cur)
40
47
      is_cur=2;                                 /* Remove current dir */
41
 
    if (! my_getwd(buff,(uint) (FN_REFLEN-strlen(path)+is_cur),MYF(0)))
42
 
      VOID(strcat(buff,path+is_cur));
 
48
    if (! getcwd(buff,(uint32_t) (FN_REFLEN-strlen(path)+is_cur)))
 
49
      strcat(buff,path+is_cur);
43
50
    else
44
 
      VOID(stpcpy(buff,path));                  /* Return org file name */
 
51
      strcpy(buff,path);                        /* Return org file name */
45
52
  }
46
53
  else
47
 
    VOID(strxmov(buff,own_path_prefix,path,NullS));
48
 
  stpcpy(to,buff);
 
54
    sprintf(buff,"%s%s",own_path_prefix,path);
 
55
  strcpy(to,buff);
49
56
  return(to);
50
57
} /* my_load_path */
 
58
 
 
59
} /* namespace internal */
 
60
} /* namespace drizzled */