Modify

Ticket #73 (closed defect: fixed)

Opened 5 years ago

Last modified 3 years ago

Semantical error in PhingFile::getParent()

Reported by: micha@… Owned by: mrook
Priority: major Milestone: 2.3.0
Component: Version: 2.2.0
Keywords: Cc:

Description

a semantical error in class PhingFile prevents method getParent() to return the parent of a directory or file if the parent is the root directory of the filesystem.

example:

  $file = new PhingFile( "/tmp" );
  $parent = $file->getParent(); // $parent is null instead of "/"

a patch that fixes this problem is attached to this ticket. the patch is created against current revision 147.

Attachments

PhingFile.php-rev147.patch Download (554 bytes) - added by micha@… 5 years ago.
Patch for PhingFile against revision 147
PhingFile.php-rev147-fixed.patch Download (553 bytes) - added by micha@… 5 years ago.

Change History

Changed 5 years ago by micha@…

Patch for PhingFile against revision 147

comment:1 Changed 5 years ago by norman@…

Sorry micha, your patch is incorrect, isn't it?

You wrote

    if (($this->prefixLength > 0) && (strlen($this->path) > $this->prefixLength))) { 
    ...
    }

but shouldn't it be

    if (($this->prefixLength > 0) && (strlen($this->path) > $this->prefixLength)) { 
    ...
    }

or am I missunderstand something? (Please count the numbers of '(' and ')'.)

Yours

Norman

comment:2 Changed 5 years ago by micha@…

you're right - sorry, my fault. fixed a semantical error and added a syntax error...

patched patch will be attached ;)

Changed 5 years ago by micha@…

comment:3 Changed 5 years ago by mrook

  • Owner set to mrook
  • Milestone set to 2.2.1

comment:4 Changed 5 years ago by mrook

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in r163.

comment:5 Changed 5 years ago by hans

  • Milestone changed from 2.2.1 to 2.3.0

Milestone 2.2.1 deleted

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.