mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-10 00:42:40 +01:00
Stop arc from destroying files under HPHPi.
Summary: Test Plan: Reviewers: CC:
This commit is contained in:
parent
309609169d
commit
c13147cf53
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue