~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/mf_dirname.cc

  • Committer: Brian Aker
  • Date: 2009-08-18 07:20:29 UTC
  • mfrom: (1117.1.9 merge)
  • Revision ID: brian@gaz-20090818072029-s9ch5lcmltxwidn7
Merge of Brian

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
 
 
16
 
#include <config.h>
17
 
 
18
 
#include <drizzled/internal/my_sys.h>
19
 
#include <drizzled/internal/m_string.h>
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#include "mysys/mysys_priv.h"
 
17
#include <mystrings/m_string.h>
20
18
 
21
19
#include <algorithm>
22
20
 
23
21
using namespace std;
24
22
 
25
 
namespace drizzled
26
 
{
27
 
namespace internal
28
 
{
29
23
 
30
24
        /* Functions definied in this file */
31
25
 
40
34
  gpos= pos++;
41
35
  for ( ; *pos ; pos++)                         /* Find last FN_LIBCHAR */
42
36
  {
43
 
    if (*pos == FN_LIBCHAR || *pos == '/')
 
37
    if (*pos == FN_LIBCHAR || *pos == '/'
 
38
#ifdef FN_C_AFTER_DIR
 
39
        || *pos == FN_C_AFTER_DIR || *pos == FN_C_AFTER_DIR_2
 
40
#endif
 
41
        )
44
42
      gpos=pos;
45
43
  }
46
44
  return gpos-name+1;
108
106
  if (!from_end || (from_end - from) > FN_REFLEN-2)
109
107
    from_end=from+FN_REFLEN -2;
110
108
 
111
 
#if FN_LIBCHAR != '/'
 
109
#if FN_LIBCHAR != '/' || defined(FN_C_BEFORE_DIR_2)
112
110
  {
113
111
    for (; from != from_end && *from ; from++)
114
112
    {
115
113
      if (*from == '/')
116
114
        *to++= FN_LIBCHAR;
 
115
#ifdef FN_C_BEFORE_DIR_2
 
116
      else if (*from == FN_C_BEFORE_DIR_2)
 
117
        *to++= FN_C_BEFORE_DIR;
 
118
      else if (*from == FN_C_AFTER_DIR_2)
 
119
        *to++= FN_C_AFTER_DIR;
 
120
#endif
117
121
      else
118
122
      {
119
123
        *to++= *from;
138
142
  }
139
143
  return(to);                              /* Pointer to end of dir */
140
144
} /* convert_dirname */
141
 
 
142
 
} /* namespace internal */
143
 
} /* namespace drizzled */