~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to mysys/mf_pack.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2000 MySQL AB
 
1
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
   This program is free software; you can redistribute it and/or modify
4
4
   it under the terms of the GNU General Public License as published by
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);
166
166
      *pos = FN_LIBCHAR;
167
167
    if (*pos == FN_LIBCHAR)
168
168
    {
169
 
      if ((size_t) (pos-start) > length && bcmp(pos-length,parent,length) == 0)
 
169
      if ((size_t) (pos-start) > length && memcmp(pos-length,parent,length) == 0)
170
170
      {                                         /* If .../../; skip prev */
171
171
        pos-=length;
172
172
        if (pos != start)
197
197
          end_parentdir=pos;
198
198
          while (pos >= start && *pos != FN_LIBCHAR)    /* remove prev dir */
199
199
            pos--;
200
 
          if (pos[1] == FN_HOMELIB || bcmp(pos,parent,length) == 0)
 
200
          if (pos[1] == FN_HOMELIB || memcmp(pos,parent,length) == 0)
201
201
          {                                     /* Don't remove ~user/ */
202
202
            pos=strmov(end_parentdir+1,parent);
203
203
            *pos=FN_LIBCHAR;
206
206
        }
207
207
      }
208
208
      else if ((size_t) (pos-start) == length-1 &&
209
 
               !bcmp(start,parent+1,length-1))
 
209
               !memcmp(start,parent+1,length-1))
210
210
        start=pos;                              /* Starts with "../" */
211
211
      else if (pos-start > 0 && pos[-1] == FN_LIBCHAR)
212
212
      {