haskell / filepath

Haskell FilePath core library
BSD 3-Clause "New" or "Revised" License
66 stars 33 forks source link

possible reversion of W.splitFileName "/\\?/a:" #219

Closed joeyh closed 5 months ago

joeyh commented 6 months ago

Before 1.4.100.2, System.FilePath.Windows.splitFileName "/\\?/a:" == ("/\\?/a:","") and in that version and since it changed to ("/\\?/","a:")

I don't fully understand Windows path semantics, and this path was generated by QuickCheck, so I don't know which is right, but 1.4.100.2 did not document any change besides optimizations. Which makes me suspect this is an unintentional change.

Also, https://github.com/haskell/filepath/pull/189/commits/6a1c98dc5eb8021107d59903bbbb60137a6f9dbd fixed a reversion in W.splitFileName "\\\\?\\A:\\fred" which seems very similar to this.

ghci> System.FilePath.Windows.splitFileName "\\\\?\\A:\\fred"
("\\\\?\\A:\\","fred")
ghci> System.FilePath.Windows.splitFileName "\\\\?\\A:\\"
("\\\\?\\A:\\","")
ghci> System.FilePath.Windows.splitFileName "\\\\?\\A:"
("\\\\?\\","A:")
Bodigrim commented 6 months ago

I can take a look over the next weekend.

hasufell commented 6 months ago

Possibly related:

joeyh commented 5 months ago

This same issue is discussed here https://github.com/haskell/filepath/pull/183#issuecomment-1880167348

hasufell commented 5 months ago

Do you have a proposed fix?

Bodigrim commented 5 months ago

I'm working on this, hopefully will finish tomorrow.