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

Diff for /texi2mdoc/util.c between version 1.17 and 1.18

version 1.17, 2015/02/28 00:03:20 version 1.18, 2015/02/28 08:41:59
Line 719  parsearg(struct texi *p, size_t *pos, size_t num)
Line 719  parsearg(struct texi *p, size_t *pos, size_t num)
  * This will stop in the event of EOF or if we're not at a bracket.   * This will stop in the event of EOF or if we're not at a bracket.
  */   */
 void  void
 parsebracket(struct texi *p, size_t *pos)  parsebracket(struct texi *p, size_t *pos, int dostack)
 {  {
         size_t            end, sv;          size_t            end, sv, stack;
         enum texicmd      cmd;          enum texicmd      cmd;
         struct teximacro *macro;          struct teximacro *macro;
   
Line 732  parsebracket(struct texi *p, size_t *pos)
Line 732  parsebracket(struct texi *p, size_t *pos)
                 return;                  return;
         advance(p, pos);          advance(p, pos);
   
           stack = 0;
         while ((*pos = advancenext(p, pos)) < BUFSZ(p)) {          while ((*pos = advancenext(p, pos)) < BUFSZ(p)) {
                 switch (BUF(p)[*pos]) {                  switch (BUF(p)[*pos]) {
                 case ('}'):                  case ('}'):
                           if (stack > 0) {
                                   stack--;
                                   advance(p, pos);
                                   texiputchar(p, '}');
                                   continue;
                           }
                         advance(p, pos);                          advance(p, pos);
                         return;                          return;
                 case ('{'):                  case ('{'):
                           if (dostack) {
                                   stack++;
                                   advance(p, pos);
                                   texiputchar(p, '{');
                                   continue;
                           }
                         if (0 == p->ign)                          if (0 == p->ign)
                                 texiwarn(p, "unexpected \"{\"");                                  texiwarn(p, "unexpected \"{\"");
                         advance(p, pos);                          advance(p, pos);
Line 874  parselinearg(struct texi *p, size_t *pos)
Line 887  parselinearg(struct texi *p, size_t *pos)
         }          }
   
         if (*pos < BUFSZ(p) && '{' == BUF(p)[*pos])          if (*pos < BUFSZ(p) && '{' == BUF(p)[*pos])
                 parsebracket(p, pos);                  parsebracket(p, pos, 0);
         else if (*pos < BUFSZ(p) && '\n' != BUF(p)[*pos])          else if (*pos < BUFSZ(p) && '\n' != BUF(p)[*pos])
                 parsesingle(p, pos);                  parsesingle(p, pos);
         else          else

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

CVSweb