From afd5eb50ea5b438ed156cb1baa846f6c20d18987 Mon Sep 17 00:00:00 2001
From: Martin Nilsson <nilsson@opera.com>
Date: Mon, 3 Jun 2013 00:57:32 +0200
Subject: [PATCH] Added missed flags and did a small code abbreviation. It is
 worrying that the testsuite did not pick this up.

---
 src/stralloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/stralloc.c b/src/stralloc.c
index 0b7dd79781..1098ff59a6 100644
--- a/src/stralloc.c
+++ b/src/stralloc.c
@@ -2054,7 +2054,7 @@ PMOD_EXPORT void set_flags_for_add( struct pike_string *ret,
     ret->max = amax;
     return;
   }
-  if( (aflags & STRING_CONTENT_CHECKED) && (b->flags & STRING_CONTENT_CHECKED) )
+  if( aflags & b->flags & STRING_CONTENT_CHECKED )
   {
     ret->min = MIN( amin, b->min );
     ret->max = MAX( amax, b->max );
@@ -2063,7 +2063,7 @@ PMOD_EXPORT void set_flags_for_add( struct pike_string *ret,
   else
     ret->flags &= ~STRING_CONTENT_CHECKED;
 
-  ret->flags = ~(STRING_IS_LOWERCASE | STRING_IS_UPPERCASE) |
+  ret->flags = (ret->flags & ~(STRING_IS_LOWERCASE | STRING_IS_UPPERCASE)) |
     (aflags & b->flags);
 }
 
-- 
GitLab