Ticket #712 (closed defect: invalid)

Opened 3 years ago

Last modified 3 years ago

File names can contain spaces

Reported by: guest Owned by:
Priority: normal Milestone:
Component: Cabal library Version: HEAD
Severity: normal Keywords:
Cc: Difficulty: unknown
GHC Version: Platform:

Description

Some operating systems support file names containing spaces. However, Cabal's package description parser breaks fields such as extra-lib-dirs on spaces, regardless of the presence or absence of quotation marks and the like. For instance, using the source tarball available from  http://hackage.haskell.org/package/Cabal, we have:

*Distribution.PackageDescription?.Parse Distribution.Compat.ReadP> readP_to_S parseFilePathQ "\"C:\\Path With Spaces\\\"" [("\"C:\\Path"," With Spaces\\\"")]

Change History

Changed 3 years ago by duncan

  • status changed from new to closed
  • resolution set to invalid

As far as I know this is correct. The example cited is a misunderstanding. The correct test is:

readP_to_S parseFilePathQ "\"C:\\\\Path With Spaces\\\\\""

because that corresponds to the Haskell String "C:\\Path With Spaces\\" which is the representation of

C:\Path With Spaces\

If one uses the following in a .cabal file then it works as expected

extra-lib-dirs: "C:\\Path With Spaces\\"

I am assuming therefore that this ticket is just a misunderstanding. If there is a genuine bug then please reopen with further details. If the bug is in the user guide then lets improve that, suggestions welcome. Or perhaps we should make it an error for a token to start with " but then to have incorrect Haskell String lexical syntax.

Note: See TracTickets for help on using tickets.