From e16d13af9416b891249d8a29f3dd4bff9e4f3ae3 Mon Sep 17 00:00:00 2001 From: thomppj Date: Sun, 30 Dec 2001 20:19:10 +0000 Subject: [PATCH] Slightly modified function. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2010 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/strings.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/functions/strings.php b/functions/strings.php index a5c0abcc..2a6a1e15 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -72,11 +72,17 @@ function readMailboxParent($haystack, $needle) { */ function next_pos_minus_white ($haystack, $pos) { $len = strlen($haystack); - for ( ; $pos < $len; $pos++ ) { - $char = substr($haystack, $pos, 1); - if ( $char != ' ' && $char != "\t" && $char != "\n" && $char != "\r" ) { + while ($pos < $len) { + /* Get the next character. */ + $c = substr($haystack, $pos, 1); + + /* Check the next character. */ + if (($c != ' ') && ($c != "\t") && ($c != "\n") && ($c != "\r")) { return $pos; } + + /* Increment position in string. */ + ++$pos; } return -1; } -- 2.25.1