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

Diff for /mandoc/tbl_layout.c between version 1.40 and 1.42

version 1.40, 2015/10/06 18:32:20 version 1.42, 2017/06/08 18:11:22
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2012, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2012, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above   * purpose with or without fee is hereby granted, provided that the above
Line 62  mods(struct tbl_node *tbl, struct tbl_cell *cp,
Line 62  mods(struct tbl_node *tbl, struct tbl_cell *cp,
                 int ln, const char *p, int *pos)                  int ln, const char *p, int *pos)
 {  {
         char            *endptr;          char            *endptr;
           size_t           sz;
   
 mod:  mod:
         while (p[*pos] == ' ' || p[*pos] == '\t')          while (p[*pos] == ' ' || p[*pos] == '\t')
Line 115  mod:
Line 116  mod:
                     ln, *pos, "m");                      ln, *pos, "m");
                 goto mod;                  goto mod;
         case 'p':          case 'p':
                 /* FALLTHROUGH */  
         case 'v':          case 'v':
                 if (p[*pos] == '-' || p[*pos] == '+')                  if (p[*pos] == '-' || p[*pos] == '+')
                         (*pos)++;                          (*pos)++;
Line 128  mod:
Line 128  mod:
         case 'u':          case 'u':
                 cp->flags |= TBL_CELL_UP;                  cp->flags |= TBL_CELL_UP;
                 goto mod;                  goto mod;
         case 'w':  /* XXX for now, ignore minimal column width */          case 'w':
                   sz = 0;
                   if (p[*pos] == '(') {
                           (*pos)++;
                           while (p[*pos + sz] != '\0' && p[*pos + sz] != ')')
                                   sz++;
                   } else
                           while (isdigit((unsigned char)p[*pos + sz]))
                                   sz++;
                   if (sz) {
                           free(cp->wstr);
                           cp->wstr = mandoc_strndup(p + *pos, sz);
                           *pos += sz;
                           if (p[*pos] == ')')
                                   (*pos)++;
                   }
                 goto mod;                  goto mod;
         case 'x':          case 'x':
                 cp->flags |= TBL_CELL_WMAX;                  cp->flags |= TBL_CELL_WMAX;
Line 168  mod:
Line 183  mod:
   
         switch (p[(*pos)++]) {          switch (p[(*pos)++]) {
         case '3':          case '3':
                 /* FALLTHROUGH */  
         case 'B':          case 'B':
                 cp->flags |= TBL_CELL_BOLD;                  cp->flags |= TBL_CELL_BOLD;
                 goto mod;                  goto mod;
         case '2':          case '2':
                 /* FALLTHROUGH */  
         case 'I':          case 'I':
                 cp->flags |= TBL_CELL_ITALIC;                  cp->flags |= TBL_CELL_ITALIC;
                 goto mod;                  goto mod;
         case '1':          case '1':
                 /* FALLTHROUGH */  
         case 'R':          case 'R':
                 goto mod;                  goto mod;
         default:          default:

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.42

CVSweb