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

Diff for /mandoc/mansearch.c between version 1.47 and 1.48

version 1.47, 2014/09/01 22:45:53 version 1.48, 2014/09/03 18:09:14
Line 80  struct expr {
Line 80  struct expr {
 struct  match {  struct  match {
         uint64_t         pageid; /* identifier in database */          uint64_t         pageid; /* identifier in database */
         char            *desc; /* manual page description */          char            *desc; /* manual page description */
         int              form; /* 0 == catpage */          int              form; /* bit field: formatted, zipped? */
 };  };
   
 static  void             buildnames(struct manpage *, sqlite3 *,  static  void             buildnames(struct manpage *, sqlite3 *,
Line 398  buildnames(struct manpage *mpage, sqlite3 *db, sqlite3
Line 398  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 463  buildnames(struct manpage *mpage, sqlite3 *db, sqlite3
Line 464  buildnames(struct manpage *mpage, sqlite3 *db, sqlite3
                 if (NULL != mpage->file)                  if (NULL != mpage->file)
                         continue;                          continue;
   
                 if (form) {                  if (form & FORM_SRC) {
                         sep1 = "man";                          sep1 = "man";
                         fsec = sec;                          fsec = sec;
                 } else {                  } else {
                         sep1 = "cat";                          sep1 = "cat";
                         fsec = "0";                          fsec = "0";
                 }                  }
                   if (form & FORM_GZ)
                           gzip = ".gz";
                   else
                           gzip = "";
                 sep2 = '\0' == *arch ? "" : "/";                  sep2 = '\0' == *arch ? "" : "/";
                 mandoc_asprintf(&mpage->file, "%s/%s%s%s%s/%s.%s",                  mandoc_asprintf(&mpage->file, "%s/%s%s%s%s/%s.%s%s",
                     path, sep1, sec, sep2, arch, name, fsec);                      path, sep1, sec, sep2, arch, name, fsec, gzip);
         }          }
         if (SQLITE_DONE != c)          if (SQLITE_DONE != c)
                 fprintf(stderr, "%s\n", sqlite3_errmsg(db));                  fprintf(stderr, "%s\n", sqlite3_errmsg(db));

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.48

CVSweb