~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/mf_format.cc

  • Committer: Monty Taylor
  • Date: 2009-03-24 17:44:41 UTC
  • mto: (960.5.2 mordred)
  • mto: This revision was merged to the branch mainline in revision 964.
  • Revision ID: mordred@inaugust.com-20090324174441-nmsq0gwjlgf7f0mt
Changed handlerton to StorageEngine.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
  else if ((flag & MY_RELATIVE_PATH) && !test_if_hard_path(dev))
43
43
  {
44
44
    /* Put 'dir' before the given path */
45
 
    strmake(buff,dev,sizeof(buff)-1);
 
45
    strncpy(buff,dev,sizeof(buff)-1);
46
46
    pos=convert_dirname(dev,dir,NULL);
47
 
    strmake(pos,buff,sizeof(buff)-1- (int) (pos-dev));
 
47
    strncpy(pos,buff,sizeof(buff)-1- (int) (pos-dev));
48
48
  }
49
49
 
50
 
  if (flag & MY_PACK_FILENAME)
51
 
    pack_dirname(dev,dev);                      /* Put in ./.. and ~/.. */
52
50
  if (flag & MY_UNPACK_FILENAME)
53
51
    (void) unpack_dirname(dev,dev);             /* Replace ~/.. with dir */
54
52
 
78
76
    size_t tmp_length;
79
77
    if (flag & MY_SAFE_PATH)
80
78
      return NULL;
81
 
    tmp_length= strlength(startpos);
82
 
    (void) strmake(to,startpos,cmin(tmp_length,FN_REFLEN-1));
 
79
    tmp_length= cmin(strlength(startpos), FN_REFLEN-1);
 
80
    strncpy(to,startpos,tmp_length);
 
81
    to[tmp_length]= '\0';
83
82
  }
84
83
  else
85
84
  {
86
85
    if (to == startpos)
87
86
    {
88
 
      memcpy(buff, name, length); /* Save name for last copy */
 
87
      memmove(buff, name, length); /* Save name for last copy */
89
88
      name=buff;
90
89
    }
91
 
    pos=strmake(my_stpcpy(to,dev),name,length);
92
 
    (void) my_stpcpy(pos,ext);                  /* Don't convert extension */
 
90
    char *tmp= strcpy(to, dev) + strlen(dev);
 
91
    pos= strncpy(tmp,name,length) + length;
 
92
    (void) strcpy(pos,ext);                     /* Don't convert extension */
93
93
  }
94
94
  /*
95
95
    If MY_RETURN_REAL_PATH and MY_RESOLVE_SYMLINK is given, only do
100
100
                                   MY_RESOLVE_LINK: 0));
101
101
  else if (flag & MY_RESOLVE_SYMLINKS)
102
102
  {
103
 
    my_stpcpy(buff,to);
 
103
    strcpy(buff,to);
104
104
    (void) my_readlink(to, buff, MYF(0));
105
105
  }
106
106
  return(to);