[BACK]Return to compat_fts.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/compat_fts.c between version 1.12 and 1.13

version 1.12, 2016/10/18 23:58:12 version 1.13, 2017/02/15 15:58:46
Line 84  fts_open(char * const *argv, int options,
Line 84  fts_open(char * const *argv, int options,
         FTS *sp;          FTS *sp;
         FTSENT *p, *root;          FTSENT *p, *root;
         int nitems;          int nitems;
         FTSENT *parent, *tmp;          FTSENT *parent, *prev;
   
         /* Options check. */          /* Options check. */
         if (options & ~FTS_OPTIONMASK) {          if (options & ~FTS_OPTIONMASK) {
Line 117  fts_open(char * const *argv, int options,
Line 117  fts_open(char * const *argv, int options,
         parent->fts_level = FTS_ROOTPARENTLEVEL;          parent->fts_level = FTS_ROOTPARENTLEVEL;
   
         /* Allocate/initialize root(s). */          /* Allocate/initialize root(s). */
         for (root = NULL, nitems = 0; *argv; ++argv, ++nitems) {          for (root = prev = NULL, nitems = 0; *argv; ++argv, ++nitems) {
                 if ((p = fts_alloc(sp, *argv, strlen(*argv))) == NULL)                  if ((p = fts_alloc(sp, *argv, strlen(*argv))) == NULL)
                         goto mem3;                          goto mem3;
                 p->fts_level = FTS_ROOTLEVEL;                  p->fts_level = FTS_ROOTLEVEL;
Line 139  fts_open(char * const *argv, int options,
Line 139  fts_open(char * const *argv, int options,
                 } else {                  } else {
                         p->fts_link = NULL;                          p->fts_link = NULL;
                         if (root == NULL)                          if (root == NULL)
                                 tmp = root = p;                                  root = p;
                         else {                          else
                                 tmp->fts_link = p;                                  prev->fts_link = p;
                                 tmp = p;                          prev = p;
                         }  
                 }                  }
         }          }
         if (compar && nitems > 1)          if (compar && nitems > 1)

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

CVSweb