From 7e7b5a440937b69c3bea7ca1146cda12bdef8ec4 Mon Sep 17 00:00:00 2001 From: Benjamin Jorand Date: Sat, 17 Jan 2009 10:03:10 +0100 Subject: [PATCH] Fixed issue in the display of filename with spaces with Mercurial. The Mercurial backend was not displaying correctly the filenames/folders having spaces in them. It was troncating at the space. --- src/IDF/Scm/Mercurial.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/IDF/Scm/Mercurial.php b/src/IDF/Scm/Mercurial.php index bf2ad4d..24b0cf1 100644 --- a/src/IDF/Scm/Mercurial.php +++ b/src/IDF/Scm/Mercurial.php @@ -149,13 +149,12 @@ class IDF_Scm_Mercurial list($hash, $perm, $exec, $file) = preg_split('/ |\t/', $line, 4); $file = trim($file); $dir = explode('/', $file, -1); - preg_match_all('|([a-zA-Z0-9_-]+)/|', $file, $dir); $tmp = ''; - for ($i=0; $i < count($dir[1]); $i++) { + for ($i=0; $i < count($dir); $i++) { if ($i > 0) { $tmp .= '/'; } - $tmp .= $dir[1][$i]; + $tmp .= $dir[$i]; if (!in_array("empty\t000\t\t$tmp/", $out_hack)) $out_hack[] = "empty\t000\t\t$tmp/"; } @@ -206,13 +205,12 @@ class IDF_Scm_Mercurial list($hash, $perm, $exec, $file) = preg_split('/ |\t/', $line, 4); $file = trim($file); $dir = explode('/', $file, -1); - preg_match_all('|([a-zA-Z0-9_-]+)/|', $file, $dir); $tmp = ''; - for ($i=0; $i < count($dir[1]); $i++) { + for ($i=0; $i < count($dir); $i++) { if ($i > 0) { $tmp .= '/'; } - $tmp .= $dir[1][$i]; + $tmp .= $dir[$i]; if (!in_array("empty\t000\t\t$tmp/", $out_hack)) { $out_hack[] = "emtpy\t000\t\t$tmp/"; }