Skip to content

Commit

Permalink
Move $position into its own else block and default it to false instea…
Browse files Browse the repository at this point in the history
…d of null.
  • Loading branch information
angrybrad authored Jun 29, 2017
1 parent 24ed4ed commit c12ae7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ public function setCommand($command)
$command = escapeshellcmd($command);
}
if ($this->getIsWindows()) {
$position = null;

// Make sure to switch to correct drive like "E:" first if we have a full path in command
if (isset($command[1]) && $command[1]===':') {
$position = 1;
// Could be a quoted absolute path because of spaces. i.e. "C:\Program Files (x86)\file.exe"
} elseif (isset($command[2]) && $command[2]===':') {
$position = 2;
} else {
$position = false;
}

// Absolute path. If it's a relative path, let it slide.
Expand Down

0 comments on commit c12ae7b

Please sign in to comment.