Skip to content

Fix filename detection in curl #385

@terriko

Description

@terriko

Like with bug #383 , curl has broken filename detection and it's probably what inspired the other two:

if filename[::-1].startswith(("curl")[::-1]):

This won't work in practice. The example below is with bluetooth but the same idea applies:

>>> filename = "bluetoothctl.so"
>>> filename[::-1]
'os.ltchtooteulb'
>>> filename[::-1].startswith(("bluetoothctl")[::-1])
False
>>>

Removing [::-1] in both places in that line should do the trick:

>>> filename.startswith(("bluetoothctl"))
True

If you're feeling ambitious, it would be nice to have a test for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions