~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/mf_pack.cc

  • Committer: Toru Maesaka
  • Date: 2008-11-29 11:58:11 UTC
  • mto: (632.1.17 devel)
  • mto: This revision was merged to the branch mainline in revision 637.
  • Revision ID: dev@torum.net-20081129115811-mbag01y7w4mwvu8f
Second pass of replacing MySQL's strmake() with libc calls

Show diffs side-by-side

added added

removed removed

Lines of Context:
252
252
    {
253
253
      if ((length= my_read(file, buff, sizeof(buff), MYF(0))) > 0)
254
254
      {
255
 
        for (pos= buff + length ;
256
 
             pos > buff && (iscntrl(pos[-1]) || isspace(pos[-1])) ;
257
 
             pos --);
258
 
 
259
 
        /* Ensure that the symlink ends with the directory symbol */
260
 
        if (pos == buff || pos[-1] != FN_LIBCHAR)
261
 
          *pos++=FN_LIBCHAR;
262
 
 
263
 
        strmake(dir,buff, (size_t) (pos-buff));
 
255
        for (pos= buff + length ;
 
256
             pos > buff && (iscntrl(pos[-1]) || isspace(pos[-1])) ;
 
257
             pos --);
 
258
 
 
259
        /* Ensure that the symlink ends with the directory symbol */
 
260
        if (pos == buff || pos[-1] != FN_LIBCHAR)
 
261
          *pos++=FN_LIBCHAR;
 
262
 
 
263
        strncpy(dir,buff, FN_REFLEN-1);
264
264
      }
265
265
      my_close(file, MYF(0));
266
266
    }
403
403
size_t system_filename(char * to, const char *from)
404
404
{
405
405
#ifndef FN_C_BEFORE_DIR
406
 
  return (size_t) (strmake(to,from,FN_REFLEN-1)-to);
 
406
  return strlen(strncpy(to,from,FN_REFLEN-1));
407
407
#else   /* VMS */
408
408
 
409
409
        /* change 'dev:lib/xxx' to 'dev:[lib]xxx' */