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

Diff for /mandoc/roff.c between version 1.342 and 1.345

version 1.342, 2018/10/25 01:32:40 version 1.345, 2018/12/12 21:54:35
Line 28 
Line 28 
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
   
 #include "mandoc.h"  
 #include "mandoc_aux.h"  #include "mandoc_aux.h"
 #include "mandoc_ohash.h"  #include "mandoc_ohash.h"
   #include "mandoc.h"
 #include "roff.h"  #include "roff.h"
   #include "tbl.h"
 #include "libmandoc.h"  #include "libmandoc.h"
 #include "roff_int.h"  #include "roff_int.h"
 #include "libroff.h"  #include "libroff.h"
Line 1067  roff_node_unlink(struct roff_man *man, struct roff_nod
Line 1068  roff_node_unlink(struct roff_man *man, struct roff_nod
 }  }
   
 void  void
   roff_node_relink(struct roff_man *man, struct roff_node *n)
   {
           roff_node_unlink(man, n);
           n->prev = n->next = NULL;
           roff_node_append(man, n);
   }
   
   void
 roff_node_free(struct roff_node *n)  roff_node_free(struct roff_node *n)
 {  {
   
Line 2107  roff_cond_sub(ROFF_ARGS)
Line 2116  roff_cond_sub(ROFF_ARGS)
         if (ep[0] == '\\' && ep[1] == '}')          if (ep[0] == '\\' && ep[1] == '}')
                 rr = 0;                  rr = 0;
   
         /* Always check for the closing delimiter `\}'. */          /*
            * The closing delimiter `\}' rewinds the conditional scope
            * but is otherwise ignored when interpreting the line.
            */
   
         while ((ep = strchr(ep, '\\')) != NULL) {          while ((ep = strchr(ep, '\\')) != NULL) {
                 switch (ep[1]) {                  switch (ep[1]) {
Line 2150  roff_cond_text(ROFF_ARGS)
Line 2162  roff_cond_text(ROFF_ARGS)
         if (roffnode_cleanscope(r))          if (roffnode_cleanscope(r))
                 irc |= endloop;                  irc |= endloop;
   
           /*
            * If `\}' occurs on a text line with neither preceding
            * nor following characters, drop the line completely.
            */
   
         ep = buf->buf + pos;          ep = buf->buf + pos;
           if (strcmp(ep, "\\}") == 0)
                   rr = 0;
   
           /*
            * The closing delimiter `\}' rewinds the conditional scope
            * but is otherwise ignored when interpreting the line.
            */
   
         while ((ep = strchr(ep, '\\')) != NULL) {          while ((ep = strchr(ep, '\\')) != NULL) {
                 if (*(++ep) == '}') {                  switch (ep[1]) {
                         *ep = '&';                  case '}':
                         if (roff_ccond(r, ln, ep - buf->buf - 1))                          memmove(ep, ep + 2, strlen(ep + 2) + 1);
                           if (roff_ccond(r, ln, ep - buf->buf))
                                 irc |= endloop;                                  irc |= endloop;
                 }                          break;
                 if (*ep != '\0')                  case '\0':
                         ++ep;                          ++ep;
                           break;
                   default:
                           ep += 2;
                           break;
                   }
         }          }
         if (rr)          if (rr)
                 irc |= ROFF_CONT;                  irc |= ROFF_CONT;

Legend:
Removed from v.1.342  
changed lines
  Added in v.1.345

CVSweb