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

Diff for /mandoc/tag.c between version 1.22 and 1.23

version 1.22, 2019/07/10 19:39:01 version 1.23, 2019/07/19 20:27:25
Line 225  tag_write(void)
Line 225  tag_write(void)
         struct tag_entry        *entry;          struct tag_entry        *entry;
         size_t                   i;          size_t                   i;
         unsigned int             slot;          unsigned int             slot;
           int                      empty;
   
         if (tag_files.tfd <= 0)          if (tag_files.tfd <= 0)
                 return;                  return;
Line 235  tag_write(void)
Line 236  tag_write(void)
         }          }
         if ((stream = fdopen(tag_files.tfd, "w")) == NULL)          if ((stream = fdopen(tag_files.tfd, "w")) == NULL)
                 mandoc_msg(MANDOCERR_FDOPEN, 0, 0, "%s", strerror(errno));                  mandoc_msg(MANDOCERR_FDOPEN, 0, 0, "%s", strerror(errno));
           empty = 1;
         entry = ohash_first(&tag_data, &slot);          entry = ohash_first(&tag_data, &slot);
         while (entry != NULL) {          while (entry != NULL) {
                 if (stream != NULL && entry->prio >= 0)                  if (stream != NULL && entry->prio >= 0) {
                         for (i = 0; i < entry->nlines; i++)                          for (i = 0; i < entry->nlines; i++) {
                                 fprintf(stream, "%s %s %zu\n",                                  fprintf(stream, "%s %s %zu\n",
                                     entry->s, tag_files.ofn, entry->lines[i]);                                      entry->s, tag_files.ofn, entry->lines[i]);
                                   empty = 0;
                           }
                   }
                 free(entry->lines);                  free(entry->lines);
                 free(entry);                  free(entry);
                 entry = ohash_next(&tag_data, &slot);                  entry = ohash_next(&tag_data, &slot);
Line 251  tag_write(void)
Line 256  tag_write(void)
         else          else
                 close(tag_files.tfd);                  close(tag_files.tfd);
         tag_files.tfd = -1;          tag_files.tfd = -1;
           if (empty) {
                   unlink(tag_files.tfn);
                   *tag_files.tfn = '\0';
           }
 }  }
   
 void  void

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

CVSweb