zoe             Thu Mar 12 20:42:46 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src    run-tests.php 
  Log:
  refixing %r in run-tests.php (thanks iain lewis for the fix)
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.35.2.62&r2=1.226.2.37.2.35.2.63&diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.226.2.37.2.35.2.62 
php-src/run-tests.php:1.226.2.37.2.35.2.63
--- php-src/run-tests.php:1.226.2.37.2.35.2.62  Tue Mar  3 10:53:44 2009
+++ php-src/run-tests.php       Thu Mar 12 20:42:46 2009
@@ -24,7 +24,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: run-tests.php,v 1.226.2.37.2.35.2.62 2009/03/03 10:53:44 zoe Exp $ */
+/* $Id: run-tests.php,v 1.226.2.37.2.35.2.63 2009/03/12 20:42:46 zoe Exp $ */
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -617,7 +617,7 @@
                                        $html_output = is_resource($html_file);
                                        break;
                                case '--version':
-                                       echo '$Revision: 1.226.2.37.2.35.2.62 
$' . "\n";
+                                       echo '$Revision: 1.226.2.37.2.35.2.63 
$' . "\n";
                                        exit(1);
 
                                default:
@@ -1738,32 +1738,32 @@
 
                if (isset($section_text['EXPECTF'])) {
 
-                // do preg_quote, but miss out any %r delimited sections
-                $temp = "";
-                $r = "%r";
-                $startOffset = 0;
-                $length = strlen($wanted_re);
-                while($startOffset < $length) {
-                  $start = strpos($wanted_re, $r, $startOffset);
-                  if ($start !== false) {
-                    // we have found a start tag
-                    $end = strpos($wanted_re, $r, $start+2);
-                    if ($end === false) {
-                      // unbalanced tag, ignore it.
-                      $end = $start = $length;
-                    }
-                  } else {
-                    // no more %r sections
-                    $start = $end = $length;
-                  }
-                  // quote a non re portion of the string
-                  $temp = $temp . preg_quote(substr($wanted_re, $startOffset, 
($start - $startOffset)),  '/');
-                  // add the re unquoted.
-                  $temp = $temp . substr($wanted_re, $start+2, ($end - 
$start-2));
-                  $startOffset = $end + 2;
-                }
-                $wanted_re = $temp;
- 
+                       // do preg_quote, but miss out any %r delimited sections
+                       $temp = "";
+                       $r = "%r";
+                       $startOffset = 0;
+                       $length = strlen($wanted_re);
+                       while($startOffset < $length) {
+                               $start = strpos($wanted_re, $r, $startOffset);
+                               if ($start !== false) {
+                                       // we have found a start tag
+                                       $end = strpos($wanted_re, $r, $start+2);
+                                       if ($end === false) {
+                                               // unbalanced tag, ignore it.
+                                               $end = $start = $length;
+                                       }
+                               } else {
+                                       // no more %r sections
+                                       $start = $end = $length;
+                               }
+                               // quote a non re portion of the string
+                               $temp = $temp . preg_quote(substr($wanted_re, 
$startOffset, ($start - $startOffset)),  '/');
+                               // add the re unquoted.
+                               $temp = $temp . '(' . substr($wanted_re, 
$start+2, ($end - $start-2)). ')';
+                               $startOffset = $end + 2;
+                       }
+                       $wanted_re = $temp;
+               
                        $wanted_re = str_replace(
                                array('%binary_string_optional%'),
                                version_compare(PHP_VERSION, '6.0.0-dev') == -1 
? 'string' : 'binary string',



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to