Skip to content

When the swift source file has a double slash path, it will cause an infinite loop #1035

@cavivie

Description

@cavivie

It works:

xcrun swift-format /Users/cavivie/Workspace/DemoSwift/Hello.swift

It does not work, and casuse an infinite loop:

xcrun swift-format /Users/cavivie/Workspace/DemoSwift//Hello.swift
xcrun swift-format /Users/cavivie/Workspace/DemoSwift/scripts/..//Hello.swift


// why candidate path output:
/Users/cavivie/Workspace/DemoSwift//Hello.swift

// I think it should be converted to:
/Users/cavivie/Workspace/DemoSwift/Hello.swift

/Users/cavivie/Workspace/DemoSwift/Hello.swift and /Users/cavivie/Workspace/DemoSwift/scripts/../Hello.swift files should be considered as one file.

Bug Line

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