fxn / i-told-you-it-was-private

MIT License
244 stars 16 forks source link

File not deleted with : in it #6

Closed schneems closed 1 year ago

schneems commented 1 year ago

It’s valid to have a : in your file name so taking the first segment isn’t guaranteed to produce a valid file.

You should pop the last element and rejoin with “:” instead.

it’s not the exact same case but I had similar issues with https://github.com/ruby/syntax_suggest/blob/main/lib/syntax_suggest/pathname_from_message.rb in which case I checked for existence of a file or dir first.

schneems commented 1 year ago

Thank goodness ❤️

fxn commented 1 year ago

I wonder how many gems are out there exploiting this flaw. Well, their time has finally arrived bastards!!!