Skip to content

DirectoryAliases.MakeAbsolute computes the wrong path if the path contains .. #4413

Description

@paulomorgado

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

Cake runner

Cake Frosting

Cake version

5.0.0

Operating system

Windows

Operating system architecture

x64

CI Server

No response

What are you seeing?

var b = context.MakeAbsolute(context.Directory(".")); // C:/repos/repo/build
var d = context.MakeAbsolute(b.Combine(new DirectoryPath("../Dashboards"))); // C:/repos/repo/build/../Dashboards

What is expected?

var b = context.MakeAbsolute(context.Directory(".")); // C:/repos/repo/build
var d = context.MakeAbsolute(b.Combine(new DirectoryPath("../Dashboards"))); // C:/repos/repo/build/Dashboards

Steps to Reproduce

var b = context.MakeAbsolute(context.Directory("."));
var d = context.MakeAbsolute(b.Combine(new DirectoryPath("../Dashboards")));

Output log

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions