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

Diff for /mandoc/Attic/mandoc-db.c between version 1.11 and 1.12

version 1.11, 2011/04/11 22:56:25 version 1.12, 2011/04/12 14:48:42
Line 731  static int
Line 731  static int
 pman_node(MAN_ARGS)  pman_node(MAN_ARGS)
 {  {
         const struct man_node *head, *body;          const struct man_node *head, *body;
         const char      *start;          const char      *start, *sv;
         const char       nil = '\0';          const char       nil = '\0';
         size_t           sz;          size_t           sz;
         uint32_t         fl;          uint32_t         fl;
Line 760  pman_node(MAN_ARGS)
Line 760  pman_node(MAN_ARGS)
                         fl = MANDOC_NAME;                          fl = MANDOC_NAME;
                         memcpy(val->data, &fl, 4);                          memcpy(val->data, &fl, 4);
   
                         start = body->string;                          assert(body->string);
                           start = sv = body->string;
   
                         /*                          /*
                          * Go through a special heuristic dance here.                           * Go through a special heuristic dance here.
Line 771  pman_node(MAN_ARGS)
Line 772  pman_node(MAN_ARGS)
                          * the name parts here.                           * the name parts here.
                          */                           */
   
                         while (start) {                          for ( ;; ) {
                                 sz = strcspn(start, " ,");                                  sz = strcspn(start, " ,");
                                 if ('\0' == start[(int)sz])                                  if ('\0' == start[(int)sz])
                                         break;                                          break;
Line 782  pman_node(MAN_ARGS)
Line 783  pman_node(MAN_ARGS)
   
                                 dbt_put(db, dbn, key, val);                                  dbt_put(db, dbn, key, val);
   
                                 if (' ' == start[(int)sz])                                  if (' ' == start[(int)sz]) {
                                           start += (int)sz + 1;
                                         break;                                          break;
                                   }
   
                                 assert(',' == start[(int)sz]);                                  assert(',' == start[(int)sz]);
                                 start += (int)sz + 1;                                  start += (int)sz + 1;
Line 791  pman_node(MAN_ARGS)
Line 794  pman_node(MAN_ARGS)
                                         start++;                                          start++;
                         }                          }
   
                         return(1);                          if (sv == start) {
                                   dbt_init(key, ksz);
                                   dbt_append(key, ksz, start);
                                   return(1);
                           }
   
                           while (' ' == *start)
                                   start++;
   
                           if ('\\' == *start && '-' == *(start + 1))
                                   start += 2;
                           else if ('-' == *start)
                                   start++;
   
                           while (' ' == *start)
                                   start++;
   
                           dbt_appendb(rval, rsz, start, strlen(start) + 1);
                 }                  }
         }          }
   

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

CVSweb