Skip to content

Commit 8636470

Browse files
committed
[TASK] fix offset with curly braces
1 parent 30b58fa commit 8636470

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/vendor/phing/system/io/Win32FileSystem.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ function getPathSeparator() {
8181
*/
8282
function normalizePrefix($strPath, $len, $sb) {
8383
$src = 0;
84-
while (($src < $len) && $this->isSlash($strPath{$src})) {
84+
while (($src < $len) && $this->isSlash($strPath[$src])) {
8585
$src++;
8686
}
8787
$c = "";
8888
if (($len - $src >= 2)
89-
&& $this->isLetter($c = $strPath{$src})
90-
&& $strPath{$src + 1} === ':') {
89+
&& $this->isLetter($c = $strPath[$src])
90+
&& $strPath[$src + 1] === ':') {
9191
/* Remove leading slashes if followed by drive specifier.
9292
* This hack is necessary to support file URLs containing drive
9393
* specifiers (e.g., "file://c:/path"). As a side effect,
@@ -138,15 +138,15 @@ protected function normalizer($strPath, $len, $offset) {
138138
// Remove redundant slashes from the remainder of the path, forcing all
139139
// slashes into the preferred slash
140140
while ($src < $len) {
141-
$c = $strPath{$src++};
141+
$c = $strPath[$src++];
142142
if ($this->isSlash($c)) {
143-
while (($src < $len) && $this->isSlash($strPath{$src})) {
143+
while (($src < $len) && $this->isSlash($strPath[$src])) {
144144
$src++;
145145
}
146146
if ($src === $len) {
147147
/* Check for trailing separator */
148148
$sn = (int) strlen($sb);
149-
if (($sn == 2) && ($sb{1} === ':')) {
149+
if (($sn == 2) && ($sb[1] === ':')) {
150150
// "z:\\"
151151
$sb .= $slash;
152152
break;
@@ -230,7 +230,7 @@ function prefixLength($strPath) {
230230
}
231231

232232
if ($this->isLetter($c0) && ($c1 === ':')) {
233-
if (($n > 2) && ($path{2}) === $slash) {
233+
if (($n > 2) && ($path[2]) === $slash) {
234234
return 3; // Absolute local pathname "z:\\foo" */
235235
}
236236
return 2; // Directory-relative "z:foo"
@@ -265,7 +265,7 @@ function resolve($parent, $child) {
265265
}
266266

267267
$p = $parent;
268-
if ($p{$pn - 1} === $slash) {
268+
if ($p[$pn - 1] === $slash) {
269269
$p = substr($p, 0, $pn - 1);
270270
}
271271
return $p.$this->slashify($c);
@@ -277,7 +277,7 @@ function getDefaultParent() {
277277

278278
function fromURIPath($strPath) {
279279
$p = (string) $strPath;
280-
if ((strlen($p) > 2) && ($p{2} === ':')) {
280+
if ((strlen($p) > 2) && ($p[2] === ':')) {
281281

282282
// "/c:/foo" --> "c:/foo"
283283
$p = substr($p,1);

0 commit comments

Comments
 (0)