Skip to content

Conversation

@mpapis
Copy link
Contributor

@mpapis mpapis commented Aug 23, 2012

fix resetting in case when removed path was moved to the end of PATH

mpapis added 2 commits August 23, 2012 03:34
fix resetting in case when removed path was moved to the end of PATH
@mpapis
Copy link
Contributor Author

mpapis commented Aug 23, 2012

this also makes sure that no accidental remove of longer similar paths will happen

@postmodern
Copy link
Owner

@mpapis checkout my attempt in the dirty_path branch.

@mpapis
Copy link
Contributor Author

mpapis commented Aug 24, 2012

I would propose to replace s|$RUBY/bin:||g with s|:$RUBY/bin:|:|g - this will avoid matching longer paths, example:

RUBY=/opt/rubies/1.9.3
PATH=/opt/rubies/1.9.3:/usr/opt/rubies/1.9.3

this would leave you with PATH=/usr - which I guess is not the intention.

@postmodern
Copy link
Owner

@mpapis like this?

@mpapis
Copy link
Contributor Author

mpapis commented Aug 24, 2012

yes, looks good

@postmodern
Copy link
Owner

Going to merge and close this. Thank you for pointing out these edge-cases. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants