~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/mf_dirname.cc

  • Committer: Monty Taylor
  • Date: 2009-02-05 21:07:57 UTC
  • mto: This revision was merged to the branch mainline in revision 840.
  • Revision ID: mordred@inaugust.com-20090205210757-6487lf69y3mndcds
Fixed warnings badness in csv_alter_table test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
  for ( ; *pos ; pos++)                         /* Find last FN_LIBCHAR */
34
34
  {
35
35
#ifdef BASKSLASH_MBTAIL
36
 
    uint l;
 
36
    uint32_t l;
37
37
    if (use_mb(fs) && (l= my_ismbchar(fs, pos, pos + 3)))
38
38
    {
39
39
      pos+= l - 1;
80
80
  SYNPOSIS
81
81
    convert_dirname()
82
82
    to                          Store result here. Must be at least of size
83
 
                                min(FN_REFLEN, strlen(from) + 1) to make room
 
83
                                cmin(FN_REFLEN, strlen(from) + 1) to make room
84
84
                                for adding FN_LIBCHAR at the end.
85
85
    from                        Original filename. May be == to
86
86
    from_end                    Pointer at end of filename (normally end \0)
91
91
    Adds a FN_LIBCHAR to end if the result string if there isn't one
92
92
    and the last isn't dev_char.
93
93
    Copies data from 'from' until ASCII(0) for until from == from_end
94
 
    If you want to use the whole 'from' string, just send NullS as the
 
94
    If you want to use the whole 'from' string, just send NULL as the
95
95
    last argument.
96
96
 
97
97
    If the result string is larger than FN_REFLEN -1, then it's cut.
130
130
      else
131
131
      {
132
132
#ifdef BACKSLASH_MBTAIL
133
 
        uint l;
 
133
        uint32_t l;
134
134
        if (use_mb(fs) && (l= my_ismbchar(fs, from, from + 3)))
135
135
        {
136
136
          memmove(to, from, l);
149
149
  }
150
150
#else
151
151
  /* This is ok even if to == from, becasue we need to cut the string */
152
 
  to= strmake(to, from, (size_t) (from_end-from));
 
152
  size_t len= cmin(strlen(from),(size_t)(from_end-from));
 
153
  assert(memmove(to, from, len));
 
154
  to+= len;
 
155
  to[0]= '\0';
153
156
#endif
154
157
 
155
158
  /* Add FN_LIBCHAR to the end of directory path */