X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fstrings.php;h=6cd038a13cecdbcc57596497d777e7b2830452b1;hb=0fbbeed6e529bbf0c616cb60273940f7a03ea6ec;hp=a5c0abcc349c23d209a2bd68eef493cd7a2ff2ce;hpb=d8943c57710fb6de7ef49d084d91d8e0c392976e;p=squirrelmail.git diff --git a/functions/strings.php b/functions/strings.php index a5c0abcc..6cd038a1 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -32,7 +32,7 @@ * SquirrelMail version number -- DO NOT CHANGE */ global $version; -$version = '1.2.2 [cvs]'; +$version = '1.2.2'; /** * If $haystack is a full mailbox name and $needle is the mailbox @@ -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; }