From: epriestley Date: Thu, 24 Feb 2011 22:08:49 +0000 (-0800) Subject: Stop arc from destroying files under HPHPi. X-Git-Tag: conduit-4~392 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=c13147cf534930b448ec93fef84c32ff1e59995e;p=arcanist.git Stop arc from destroying files under HPHPi. Summary: Test Plan: Reviewers: CC: --- diff --git a/src/lint/patcher/ArcanistLintPatcher.php b/src/lint/patcher/ArcanistLintPatcher.php index eefb8ad6..de687147 100644 --- a/src/lint/patcher/ArcanistLintPatcher.php +++ b/src/lint/patcher/ArcanistLintPatcher.php @@ -106,7 +106,12 @@ final class ArcanistLintPatcher { $new_str = $lint->getReplacementText(); $new_len = strlen($new_str); - $data = substr_replace($data, $new_str, $working_offset, $old_len); + if ($working_offset == strlen($data)) { + // Temporary hack to work around a destructive hphpi issue, see #451031. + $data .= $new_str; + } else { + $data = substr_replace($data, $new_str, $working_offset, $old_len); + } $this->changeCharacterDelta($new_len - $old_len); $this->setDirtyCharacterOffset($orig_offset + $old_len);