From dd2fa6f90290c91bda577fc7c2a9bfc1398edb7b Mon Sep 17 00:00:00 2001 From: Thomas Keller Date: Fri, 4 May 2012 01:01:33 +0200 Subject: [PATCH] Remove OS9 line ending support again, this was left out for a reason. Fix tests after issue 804 was fixed. --- src/IDF/FileUtil.php | 4 +++- .../test-02-svn-new-files-with-properties.expected | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/IDF/FileUtil.php b/src/IDF/FileUtil.php index b63621a..222046c 100644 --- a/src/IDF/FileUtil.php +++ b/src/IDF/FileUtil.php @@ -147,6 +147,8 @@ class IDF_FileUtil * Splits a string into separate lines while retaining the individual * line ending character for every line. * + * OS 9 line endings are not supported. + * * @param string content * @param boolean if true, skip completely empty lines * @return string @@ -155,7 +157,7 @@ class IDF_FileUtil { $last_off = 0; $lines = array(); - while (preg_match("/\r\n|\n|\r/", $content, $m, PREG_OFFSET_CAPTURE, $last_off)) { + while (preg_match("/\r\n|\n/", $content, $m, PREG_OFFSET_CAPTURE, $last_off)) { $next_off = strlen($m[0][0]) + $m[0][1]; $line = substr($content, $last_off, $next_off - $last_off); $last_off = $next_off; diff --git a/test/data/IDF_DiffTest/test-02-svn-new-files-with-properties.expected b/test/data/IDF_DiffTest/test-02-svn-new-files-with-properties.expected index 964b6e5..18bec97 100644 --- a/test/data/IDF_DiffTest/test-02-svn-new-files-with-properties.expected +++ b/test/data/IDF_DiffTest/test-02-svn-new-files-with-properties.expected @@ -80,7 +80,6 @@ 0 => '', 1 => 11, 2 => ' - ', ), ), @@ -102,4 +101,4 @@ ), ), ), -); \ No newline at end of file +);