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

Diff for /mandoc/mansearch.c between version 1.50 and 1.51

version 1.50, 2014/11/18 01:15:21 version 1.51, 2014/11/27 01:58:21
Line 410  buildnames(struct manpage *mpage, sqlite3 *db, sqlite3
Line 410  buildnames(struct manpage *mpage, sqlite3 *db, sqlite3
 {  {
         char            *newnames, *prevsec, *prevarch;          char            *newnames, *prevsec, *prevarch;
         const char      *oldnames, *sep1, *name, *sec, *sep2, *arch, *fsec;          const char      *oldnames, *sep1, *name, *sec, *sep2, *arch, *fsec;
         const char      *gzip;  
         size_t           i;          size_t           i;
         int              c;          int              c;
   
Line 473  buildnames(struct manpage *mpage, sqlite3 *db, sqlite3
Line 472  buildnames(struct manpage *mpage, sqlite3 *db, sqlite3
   
                 /* Also save the first file name encountered. */                  /* Also save the first file name encountered. */
   
                 if (NULL != mpage->file)                  if (mpage->file != NULL)
                         continue;                          continue;
   
                 if (form & FORM_SRC) {                  if (form & FORM_SRC) {
Line 483  buildnames(struct manpage *mpage, sqlite3 *db, sqlite3
Line 482  buildnames(struct manpage *mpage, sqlite3 *db, sqlite3
                         sep1 = "cat";                          sep1 = "cat";
                         fsec = "0";                          fsec = "0";
                 }                  }
                 if (form & FORM_GZ)                  sep2 = *arch == '\0' ? "" : "/";
                         gzip = ".gz";                  mandoc_asprintf(&mpage->file, "%s/%s%s%s%s/%s.%s",
                 else                      path, sep1, sec, sep2, arch, name, fsec);
                         gzip = "";  
                 sep2 = '\0' == *arch ? "" : "/";  
                 mandoc_asprintf(&mpage->file, "%s/%s%s%s%s/%s.%s%s",  
                     path, sep1, sec, sep2, arch, name, fsec, gzip);  
         }          }
         if (SQLITE_DONE != c)          if (c != SQLITE_DONE)
                 fprintf(stderr, "%s\n", sqlite3_errmsg(db));                  fprintf(stderr, "%s\n", sqlite3_errmsg(db));
         sqlite3_reset(s);          sqlite3_reset(s);
   
         /* Append one final section to the names. */          /* Append one final section to the names. */
   
         if (NULL != prevsec) {          if (prevsec != NULL) {
                 sep2 = '\0' == *prevarch ? "" : "/";                  sep2 = *prevarch == '\0' ? "" : "/";
                 mandoc_asprintf(&newnames, "%s(%s%s%s)",                  mandoc_asprintf(&newnames, "%s(%s%s%s)",
                     mpage->names, prevsec, sep2, prevarch);                      mpage->names, prevsec, sep2, prevarch);
                 free(mpage->names);                  free(mpage->names);

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51

CVSweb