This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 8b0788a195c0339682a1a6f702a407f5ce2400ae
Author: Arrigo Marchiori <[email protected]>
AuthorDate: Sat Sep 12 22:04:30 2026 +0200

    Fix the "skip" logic for the first value in the stack
    
    (cherry picked from commits 18ed205ebc520f73147ebe4bd1a879a2fccda720
    and 17d397d7eb7e2935ed88d281ee3068516ad1cd47)
---
 main/rsc/source/rscpp/cpp5.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/main/rsc/source/rscpp/cpp5.c b/main/rsc/source/rscpp/cpp5.c
index 0d05390f0c..4558665c65 100644
--- a/main/rsc/source/rscpp/cpp5.c
+++ b/main/rsc/source/rscpp/cpp5.c
@@ -240,6 +240,7 @@ eval()
        opp->prec = opdope[OP_END];     /* And its precedence           */
        opp->skip = 0;                  /* Not skipping now             */
        binop = 0;
+       skip = 0;
 again: ;
 #ifdef DEBUG_EVAL
     fprintf( pCppOut, "In #if at again: skip = %d, binop = %d, line is: %s",
@@ -306,7 +307,9 @@ again:      ;
                }
                opp->op = (char)op;
                opp->prec = (char)prec;
-               skip = (valp[-1] != 0);         /* Short-circuit tester */
+               if (valp > value) {
+                   skip = (valp[-1] != 0);             /* Short-circuit tester 
*/
+               }
                /*
                 * Do the short-circuit stuff here.  Short-circuiting
                 * stops automagically when operators are evaluated.

Reply via email to