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

Diff for /mandoc/roff_term.c between version 1.21 and 1.22

version 1.21, 2020/09/03 17:42:15 version 1.22, 2020/09/03 20:43:15
Line 1 
Line 1 
 /* $Id$ */  /* $OpenBSD$ */
 /*  /*
  * Copyright (c) 2010,2014,2015,2017-2019 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2010,2014,2015,2017-2020 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 157  static void
Line 157  static void
 roff_term_pre_po(ROFF_TERM_ARGS)  roff_term_pre_po(ROFF_TERM_ARGS)
 {  {
         struct roffsu    su;          struct roffsu    su;
         static int       po, polast;          static int       po, pouse, polast;
         int              ponew;          int              ponew;
   
           /* Revert the currently active page offset. */
           p->tcol->offset -= pouse;
   
           /* Determine the requested page offset. */
         if (n->child != NULL &&          if (n->child != NULL &&
             a2roffsu(n->child->string, &su, SCALE_EM) != NULL) {              a2roffsu(n->child->string, &su, SCALE_EM) != NULL) {
                 ponew = term_hen(p, &su);                  ponew = term_hen(p, &su);
Line 168  roff_term_pre_po(ROFF_TERM_ARGS)
Line 172  roff_term_pre_po(ROFF_TERM_ARGS)
                         ponew += po;                          ponew += po;
         } else          } else
                 ponew = polast;                  ponew = polast;
   
           /* Remeber both the previous and the newly requested offset. */
         polast = po;          polast = po;
         po = ponew;          po = ponew;
   
         ponew = po - polast + (int)p->tcol->offset;          /* Truncate to the range [-offset, 60], remember, and apply it. */
         p->tcol->offset = ponew > 0 ? ponew : 0;          pouse = po >= 60 ? 60 :
               po < -(int)p->tcol->offset ? -p->tcol->offset : po;
           p->tcol->offset += pouse;
 }  }
   
 static void  static void

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

CVSweb