Ticket #3975 (closed bug: fixed)

Opened 3 years ago

Last modified 22 months ago

filepath: normalise trailing dot

Reported by: conrad Owned by:
Priority: normal Milestone: Not GHC
Component: libraries (other) Version: 6.12.1
Keywords: filepath normalise Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect result at runtime Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

This darcs patch modifies the behaviour of normalise to handle trailing dots in a path. The previous behaviour yielded this:

Prelude System.FilePath> normalise "../."
"../."
Prelude System.FilePath> normalise ".././"
".././"
Prelude System.FilePath> normalise ".././.."
"../.."

This patch modifies dropDots such that the check for (".":[]) only occurs once for the path, after which a driver function dropDots' is used which skips this check. Hence "." can be removed from the end of a longer path, but a path of just "." is unchanged.

 http://www.haskell.org/pipermail/libraries/2010-February/013030.html

Attachments

normalise-trailing-dot.patch Download (3.6 KB) - added by conrad 3 years ago.
normalise-trailing-dot-v2.patch Download (6.6 KB) - added by conrad 3 years ago.
Version 2, ensures directories retain trailing pathSeparator

Change History

Changed 3 years ago by conrad

Changed 3 years ago by igloo

  • milestone set to Not GHC

Changed 3 years ago by ross

  • component changed from libraries/base to libraries (other)

Changed 3 years ago by igloo

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

This looks like an abandoned proposal. If that's not the case, please re-open and give a link to the discussion thread, a summary of the discussion, and the consensus decision, as described on the  process page.

Changed 3 years ago by conrad

  • status changed from closed to new
  • resolution wontfix deleted

Links to the discussion thread:

 http://www.haskell.org/pipermail/libraries/2010-February/013030.html  http://www.haskell.org/pipermail/libraries/2010-April/013477.html

Summary: the only response was a +1 from Neil Mitchell (the original author of filepath)

Changed 3 years ago by conrad

Added discussion period of 2 weeks (by Dec 15 2010)

 http://www.haskell.org/pipermail/libraries/2010-December/015218.html

Changed 3 years ago by conrad

Version 2, ensures directories retain trailing pathSeparator

Changed 3 years ago by conrad

  • status changed from new to patch

Changed 2 years ago by igloo

  • status changed from patch to closed
  • resolution set to fixed

Applied, thanks

Changed 23 months ago by nad

  • status changed from closed to new
  • type changed from proposal to bug
  • resolution fixed deleted

Is filepath supposed to follow the package versioning policy? If it is, then the new semantics of normalise should have been accompanied by an increased major version number. To minimise damage you may want to upload two new copies of filepath: 1.2.0.2 (a copy of 1.2.0.0) and 1.3.0.0 (a copy of 1.2.0.1).

On a related note, is the following behaviour intended?

> normalise "/"
"/."

Changed 22 months ago by igloo

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

I've fixed normalise "/" in

commit 014dba4283b35a755894b333c931eedec6135290
Author: Ian Lynagh <igloo@earth.li>
Date:   Sun Aug 28 19:17:40 2011 +0100

    System.FilePath.normalise "/" should be "/", not "/.". Fixes trac #3975

I'm not sure it's worth uploading more versions of filepath. 7.2.1 comes with 1.2.0.1, so I think the damage is already done.

Note: See TracTickets for help on using tickets.