From a4a7eba184bce4cd0a68ce5428b1ea7dcbfaa822 Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan@rename-it.nl>
Date: Mon, 21 Jul 2008 01:52:49 +0200
Subject: [PATCH] Removed direct use of isdigit, isalpha and isalnum and
 replaced these with their dovecot i_* equivalents to prevent problems on some
 systems.

---
 .../comparator-i-ascii-numeric/ext-cmp-i-ascii-numeric.c  | 8 ++++----
 src/lib-sieve/plugins/variables/ext-variables-name.c      | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/lib-sieve/plugins/comparator-i-ascii-numeric/ext-cmp-i-ascii-numeric.c b/src/lib-sieve/plugins/comparator-i-ascii-numeric/ext-cmp-i-ascii-numeric.c
index 760175c99..35de40f83 100644
--- a/src/lib-sieve/plugins/comparator-i-ascii-numeric/ext-cmp-i-ascii-numeric.c
+++ b/src/lib-sieve/plugins/comparator-i-ascii-numeric/ext-cmp-i-ascii-numeric.c
@@ -107,7 +107,7 @@ static int cmp_i_ascii_numeric_compare
 		kp++;
 
 	while ( vp < vend && kp < kend ) {
-		if ( !isdigit(*vp) || !isdigit(*kp) ) 
+		if ( !i_isdigit(*vp) || !i_isdigit(*kp) ) 
 			break;
 
 		if ( *vp != *kp ) 
@@ -117,12 +117,12 @@ static int cmp_i_ascii_numeric_compare
 		kp++;	
 	}
 
-	if ( vp == vend || !isdigit(*vp) ) {
-		if ( kp == kend || !isdigit(*kp) ) 
+	if ( vp == vend || !i_isdigit(*vp) ) {
+		if ( kp == kend || !i_isdigit(*kp) ) 
 			return 0;
 		else	
 			return -1;
-	} else if ( kp == kend || !isdigit(*kp) )  
+	} else if ( kp == kend || !i_isdigit(*kp) )  
 		return 1;
 		
 	return (*vp > *kp);
diff --git a/src/lib-sieve/plugins/variables/ext-variables-name.c b/src/lib-sieve/plugins/variables/ext-variables-name.c
index e4b2675fb..ac9f00920 100644
--- a/src/lib-sieve/plugins/variables/ext-variables-name.c
+++ b/src/lib-sieve/plugins/variables/ext-variables-name.c
@@ -32,23 +32,23 @@ int ext_variable_name_parse
 		}
 
 		/* Identifier */
-		if ( *p == '_' || isalpha(*p) ) {
+		if ( *p == '_' || i_isalpha(*p) ) {
 			cur_element->num_variable = -1;
 			str_truncate(cur_ident, 0);
 			str_append_c(cur_ident, *p);
 			p++;
 		
-			while ( p < strend && (*p == '_' || isalnum(*p)) ) {
+			while ( p < strend && (*p == '_' || i_isalnum(*p)) ) {
 				str_append_c(cur_ident, *p);
 				p++;
 			}
 		
 		/* Num-variable */
-		} else if ( isdigit(*p) ) {
+		} else if ( i_isdigit(*p) ) {
 			cur_element->num_variable = *p - '0';
 			p++;
 			
-			while ( p < strend && isdigit(*p) ) {
+			while ( p < strend && i_isdigit(*p) ) {
 				cur_element->num_variable = cur_element->num_variable*10 + (*p - '0');
 				p++;
 			} 
-- 
GitLab