Ticket #73 (closed defect: fixed)

Opened 1 year ago

Last modified 9 months ago

Semantical error in PhingFile::getParent()

Reported by: micha@aichler.net Assigned to: 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 (0.5 kB) - added by micha@aichler.net on 02/08/07 21:17:01.
Patch for PhingFile against revision 147
PhingFile.php-rev147-fixed.patch (0.5 kB) - added by micha@aichler.net on 02/13/07 11:03:39.

Change History

02/08/07 21:17:01 changed by micha@aichler.net

  • attachment PhingFile.php-rev147.patch added.

Patch for PhingFile against revision 147

02/13/07 10:51:59 changed by norman@sefiroth.de

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

02/13/07 11:02:54 changed by micha@aichler.net

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

patched patch will be attached ;)

02/13/07 11:03:39 changed by micha@aichler.net

  • attachment PhingFile.php-rev147-fixed.patch added.

02/16/07 09:04:41 changed by mrook

  • owner set to mrook.
  • milestone set to 2.2.1.

02/16/07 09:07:51 changed by mrook

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in r163.

11/03/07 14:24:02 changed by hans

  • milestone changed from 2.2.1 to 2.3.0.

Milestone 2.2.1 deleted


Add/Change #73 (Semantical error in PhingFile::getParent())




Action