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

Diff for /texi2mdoc/main.c between version 1.69 and 1.70

version 1.69, 2015/03/13 08:07:33 version 1.70, 2015/03/13 08:13:21
Line 1516  indexcmp(const void *p1, const void *p2)
Line 1516  indexcmp(const void *p1, const void *p2)
 static void  static void
 doprintindex(struct texi *p, enum texicmd cmd, size_t *pos)  doprintindex(struct texi *p, enum texicmd cmd, size_t *pos)
 {  {
         size_t   i, j, start, end, len;          static size_t    guard = 0;
           size_t           i, j, start, end, len;
 #if HAVE_INDEX  #if HAVE_INDEX
         char    *cp;          char            *cp;
         char     buf[PATH_MAX];          char             buf[PATH_MAX];
 #endif  #endif
   
           if (guard++ > 8)
                   texierr(p, "recursive @printindex");
   
         while (*pos < BUFSZ(p) && isws(BUF(p)[*pos]))          while (*pos < BUFSZ(p) && isws(BUF(p)[*pos]))
                 advance(p, pos);                  advance(p, pos);
         start = *pos;          start = *pos;
Line 1529  doprintindex(struct texi *p, enum texicmd cmd, size_t 
Line 1533  doprintindex(struct texi *p, enum texicmd cmd, size_t 
                 advance(p, pos);                  advance(p, pos);
         if ((end = *pos) == BUFSZ(p)) {          if ((end = *pos) == BUFSZ(p)) {
                 texiwarn(p, "unexpected EOF");                  texiwarn(p, "unexpected EOF");
                   guard--;
                 return;                  return;
         }          }
   
         advance(p, pos);          advance(p, pos);
         if (*pos == BUFSZ(p)) {          if (*pos == BUFSZ(p)) {
                 texiwarn(p, "unexpected EOF");                  texiwarn(p, "unexpected EOF");
                   guard--;
                 return;                  return;
         } else if (0 == (len = end - start)) {          } else if (0 == (len = end - start)) {
                 texiwarn(p, "zero-length index");                  texiwarn(p, "zero-length index");
                   guard--;
                 return;                  return;
         }          }
   
Line 1552  doprintindex(struct texi *p, enum texicmd cmd, size_t 
Line 1559  doprintindex(struct texi *p, enum texicmd cmd, size_t 
   
         if (i == p->indexsz) {          if (i == p->indexsz) {
                 texiwarn(p, "cannot find index");                  texiwarn(p, "cannot find index");
                   guard--;
                 return;                  return;
         } else if (0 == p->indexs[i].indexsz)          } else if (0 == p->indexs[i].indexsz) {
                   guard--;
                 return;                  return;
           }
   
         /* Alphabetically sort our indices. */          /* Alphabetically sort our indices. */
         qsort(p->indexs[i].index,          qsort(p->indexs[i].index,
Line 1601  doprintindex(struct texi *p, enum texicmd cmd, size_t 
Line 1611  doprintindex(struct texi *p, enum texicmd cmd, size_t 
         p->seenvs = 0;          p->seenvs = 0;
         teximacro(p, "El");          teximacro(p, "El");
         texivspace(p);          texivspace(p);
           guard--;
 }  }
   
 static void  static void

Legend:
Removed from v.1.69  
changed lines
  Added in v.1.70

CVSweb