~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/mf_pack.c

Merged build changes from Antony.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
#include "mysys_priv.h"
17
 
#include <m_string.h>
 
17
#include <mystrings/m_string.h>
18
18
#include "my_static.h"
19
19
#ifdef HAVE_PWD_H
20
20
#include <pwd.h>
52
52
    buff_length= strlen(buff);
53
53
    d_length= (size_t) (start-to);
54
54
    if ((start == to ||
55
 
         (buff_length == d_length && !bcmp(buff,start,d_length))) &&
 
55
         (buff_length == d_length && !memcmp(buff,start,d_length))) &&
56
56
        *start != FN_LIBCHAR && *start)
57
57
    {                                           /* Put current dir before */
58
58
      bchange((uchar*) to, d_length, (uchar*) buff, buff_length, strlen(to)+1);
70
70
    }
71
71
    if (length > 1 && length < d_length)
72
72
    {                                           /* test if /xx/yy -> ~/yy */
73
 
      if (bcmp(to,home_dir,length) == 0 && to[length] == FN_LIBCHAR)
 
73
      if (memcmp(to,home_dir,length) == 0 && to[length] == FN_LIBCHAR)
74
74
      {
75
75
        to[0]=FN_HOMELIB;                       /* Filename begins with ~ */
76
76
        (void) strmov_overlapp(to+1,to+length);
80
80
    {                                           /* Test if cwd is ~/... */
81
81
      if (length > 1 && length < buff_length)
82
82
      {
83
 
        if (bcmp(buff,home_dir,length) == 0 && buff[length] == FN_LIBCHAR)
 
83
        if (memcmp(buff,home_dir,length) == 0 && buff[length] == FN_LIBCHAR)
84
84
        {
85
85
          buff[0]=FN_HOMELIB;
86
86
          (void) strmov_overlapp(buff+1,buff+length);
163
163
      *pos = FN_LIBCHAR;
164
164
    if (*pos == FN_LIBCHAR)
165
165
    {
166
 
      if ((size_t) (pos-start) > length && bcmp(pos-length,parent,length) == 0)
 
166
      if ((size_t) (pos-start) > length &&
 
167
          memcmp(pos-length,parent,length) == 0)
167
168
      {                                         /* If .../../; skip prev */
168
169
        pos-=length;
169
170
        if (pos != start)
194
195
          end_parentdir=pos;
195
196
          while (pos >= start && *pos != FN_LIBCHAR)    /* remove prev dir */
196
197
            pos--;
197
 
          if (pos[1] == FN_HOMELIB || bcmp(pos,parent,length) == 0)
 
198
          if (pos[1] == FN_HOMELIB || memcmp(pos,parent,length) == 0)
198
199
          {                                     /* Don't remove ~user/ */
199
200
            pos=strmov(end_parentdir+1,parent);
200
201
            *pos=FN_LIBCHAR;
203
204
        }
204
205
      }
205
206
      else if ((size_t) (pos-start) == length-1 &&
206
 
               !bcmp(start,parent+1,length-1))
 
207
               !memcmp(start,parent+1,length-1))
207
208
        start=pos;                              /* Starts with "../" */
208
209
      else if (pos-start > 0 && pos[-1] == FN_LIBCHAR)
209
210
      {
320
321
        if (tilde_expansion[h_length-1] == FN_LIBCHAR)
321
322
          h_length--;
322
323
        if (buff+h_length < suffix)
323
 
          bmove(buff+h_length,suffix,length);
 
324
          memcpy(buff+h_length, suffix, length);
324
325
        else
325
326
          bmove_upp((uchar*) buff+h_length+length, (uchar*) suffix+length, length);
326
 
        bmove(buff,tilde_expansion,h_length);
 
327
        memcpy(buff, tilde_expansion, h_length);
327
328
      }
328
329
    }
329
330
  }