[BACK]Return to glob.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libc / gen

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libc/gen/glob.c between version 1.34 and 1.35

version 1.34, 2013/02/21 18:17:43 version 1.35, 2013/03/20 23:44:47
Line 132  struct glob_limit {
Line 132  struct glob_limit {
 #define M_MASK          0xffff  #define M_MASK          0xffff
 #define M_ASCII         0x00ff  #define M_ASCII         0x00ff
   
 typedef u_short Char;  typedef unsigned short Char;
   
 #else  #else
   
Line 183  int
Line 183  int
 glob(const char * __restrict pattern, int flags, int (*errfunc)(const char *,  glob(const char * __restrict pattern, int flags, int (*errfunc)(const char *,
     int), glob_t * __restrict pglob)      int), glob_t * __restrict pglob)
 {  {
         const u_char *patnext;          const unsigned char *patnext;
         int c;          int c;
         Char *bufnext, *bufend, patbuf[MAXPATHLEN+1];          Char *bufnext, *bufend, patbuf[MAXPATHLEN+1];
         struct glob_limit limit = { 0, 0, 0, 0 };          struct glob_limit limit = { 0, 0, 0, 0 };
   
         _DIAGASSERT(pattern != NULL);          _DIAGASSERT(pattern != NULL);
   
         patnext = (const u_char *) pattern;          patnext = (const unsigned char *) pattern;
         if (!(flags & GLOB_APPEND)) {          if (!(flags & GLOB_APPEND)) {
                 pglob->gl_pathc = 0;                  pglob->gl_pathc = 0;
                 pglob->gl_pathv = NULL;                  pglob->gl_pathv = NULL;
Line 770  glob3(Char *pathbuf, Char *pathend, Char
Line 770  glob3(Char *pathbuf, Char *pathend, Char
         else          else
                 readdirfunc = (struct dirent *(*)(void *)) readdir;                  readdirfunc = (struct dirent *(*)(void *)) readdir;
         while ((dp = (*readdirfunc)(dirp)) != NULL) {          while ((dp = (*readdirfunc)(dirp)) != NULL) {
                 u_char *sc;                  unsigned char *sc;
                 Char *dc;                  Char *dc;
   
                 if ((pglob->gl_flags & GLOB_LIMIT) &&                  if ((pglob->gl_flags & GLOB_LIMIT) &&
Line 801  glob3(Char *pathbuf, Char *pathend, Char
Line 801  glob3(Char *pathbuf, Char *pathend, Char
                  * The resulting string contains EOS, so we can                   * The resulting string contains EOS, so we can
                  * use the pathlim character, if it is the nul                   * use the pathlim character, if it is the nul
                  */                   */
                 for (sc = (u_char *) dp->d_name, dc = pathend;                  for (sc = (unsigned char *) dp->d_name, dc = pathend;
                      dc <= pathlim && (*dc++ = *sc++) != EOS;)                       dc <= pathlim && (*dc++ = *sc++) != EOS;)
                         continue;                          continue;
   

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

CVSweb <webmaster@jp.NetBSD.org>