Pick safe default algorithm for Pathname#cleanpath #213

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@eam
eam commented Nov 14, 2012

Pathname#cleanpath is a purely lexical cleanup of a unix path, to remove
useless syntax and return an equivalent path. However, the current default
algorithm makes choices that can return semantically different paths.

This patch sets the default algorithm to the safe alternative, guaranteeing the
return of a semantically identical path. The unsafe/aggressive algorithm
remains and can be enabled where appropriate.

@eam eam Pick safe default algorithm for Pathname#cleanpath
Pathname#cleanpath is a purely lexical cleanup of a unix path, to remove
useless syntax and return an equivalent path. However, the current default
algorithm makes choices that can return semantically different paths.

This patch sets the default algorithm to the safe alternative, guaranteeing the
return of a semantically identical path. The unsafe/aggressive algorithm
remains and can be enabled where appropriate.
0c841f9
@eam
eam commented Nov 14, 2012

For added context, here's an example of how this can currently fail: https://gist.github.com/4069375

@zzak
Member
zzak commented Nov 19, 2012

Closing this, please refer to Feature #7401 in redmine

@zzak zzak closed this Nov 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment