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

Diff for /mandoc/Attic/mdoc_action.c between version 1.3 and 1.7

version 1.3, 2009/04/02 06:51:44 version 1.7, 2009/04/06 09:48:35
Line 195  const struct actions mdoc_actions[MDOC_MAX] = {
Line 195  const struct actions mdoc_actions[MDOC_MAX] = {
   
   
 #ifdef __linux__  #ifdef __linux__
 extern  size_t  strlcpy(char *, const char *, size_t);  
 extern  size_t  strlcat(char *, const char *, size_t);  extern  size_t  strlcat(char *, const char *, size_t);
 #endif  #endif
   
Line 213  mdoc_action_pre(struct mdoc *m, const struct mdoc_node
Line 212  mdoc_action_pre(struct mdoc *m, const struct mdoc_node
                 break;                  break;
         }          }
   
         if (NULL == mdoc_actions[m->last->tok].pre)          if (NULL == mdoc_actions[n->tok].pre)
                 return(1);                  return(1);
         return((*mdoc_actions[m->last->tok].pre)(m, n));          return((*mdoc_actions[n->tok].pre)(m, n));
 }  }
   
   
Line 344  post_nm(POST_ARGS)
Line 343  post_nm(POST_ARGS)
   
         if (m->meta.name)          if (m->meta.name)
                 return(1);                  return(1);
   
           buf[0] = 0;
         if ( ! concat(m, m->last->child, buf, sizeof(buf)))          if ( ! concat(m, m->last->child, buf, sizeof(buf)))
                 return(0);                  return(0);
   
         if (NULL == (m->meta.name = strdup(buf)))          if (NULL == (m->meta.name = strdup(buf)))
                 return(verr(m, EMALLOC));                  return(verr(m, EMALLOC));
   
Line 367  post_sh(POST_ARGS)
Line 369  post_sh(POST_ARGS)
   
         if (MDOC_HEAD != m->last->type)          if (MDOC_HEAD != m->last->type)
                 return(1);                  return(1);
   
           buf[0] = 0;
         if ( ! concat(m, m->last->child, buf, sizeof(buf)))          if ( ! concat(m, m->last->child, buf, sizeof(buf)))
                 return(0);                  return(0);
         if (SEC_CUSTOM != (sec = mdoc_atosec(buf)))          if (SEC_CUSTOM != (sec = mdoc_atosec(buf)))
Line 495  post_os(POST_ARGS)
Line 499  post_os(POST_ARGS)
   
         if (m->meta.os)          if (m->meta.os)
                 free(m->meta.os);                  free(m->meta.os);
   
           buf[0] = 0;
         if ( ! concat(m, m->last->child, buf, sizeof(buf)))          if ( ! concat(m, m->last->child, buf, sizeof(buf)))
                 return(0);                  return(0);
   
         if (0 == buf[0]) {          if (0 == buf[0]) {
                 if (-1 == uname(&utsname))                  if (-1 == uname(&utsname))
                         return(mdoc_err(m, "utsname"));                          return(mdoc_err(m, "utsname"));
                 if (strlcpy(buf, utsname.sysname, 64) >= 64)                  if (strlcat(buf, utsname.sysname, 64) >= 64)
                         return(verr(m, ETOOLONG));                          return(verr(m, ETOOLONG));
                 if (strlcat(buf, " ", 64) >= 64)                  if (strlcat(buf, " ", 64) >= 64)
                         return(verr(m, ETOOLONG));                          return(verr(m, ETOOLONG));
Line 693  post_dd(POST_ARGS)
Line 699  post_dd(POST_ARGS)
 {  {
         char              buf[64];          char              buf[64];
   
           buf[0] = 0;
         if ( ! concat(m, m->last->child, buf, sizeof(buf)))          if ( ! concat(m, m->last->child, buf, sizeof(buf)))
                 return(0);                  return(0);
   

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.7

CVSweb