Move comparison to pattern. - tgtimes - The Gopher Times
 (HTM) git clone git://bitreich.org/tgtimes git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/tgtimes
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Tags
 (DIR) README
       ---
 (DIR) commit 6eeb4cd1faa551f33e0662379c6104d9027ecbaf
 (DIR) parent bef5987b8456b7c83745e4561debe8264866d6fa
 (HTM) Author: Troels Henriksen <athas@sigkill.dk>
       Date:   Sun, 27 Aug 2023 22:06:08 +0200
       
       Move comparison to pattern.
       
       Signed-off-by: Christoph Lohmann <20h@r-36.net>
       
       Diffstat:
         M filters/nudge.filter                |      18 ++++++++----------
       
       1 file changed, 8 insertions(+), 10 deletions(-)
       ---
 (DIR) diff --git a/filters/nudge.filter b/filters/nudge.filter
       @@ -11,17 +11,15 @@ BEGIN {
            incontent=1
        }
        
       -/./ {
       -    if (incontent == 0) {
       -           spaces=LINES_PER_PAGE - line % LINES_PER_PAGE + 1;
       -           if (spaces < MAX_SPACING) {
       -                  for (i = 0; i < spaces; i++) {
       -                      print "";
       -                      line++;
       -                  }
       -              }
       -           incontent = 1;
       +/./ && incontent == 0 {
       +    spaces=LINES_PER_PAGE - line % LINES_PER_PAGE + 1;
       +    if (spaces < MAX_SPACING) {
       +        for (i = 0; i < spaces; i++) {
       +            print "";
       +            line++;
       +        }
            }
       +    incontent = 1;
        }
        /`----/ { incontent = 0; }
        { print $0; line++; }