Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bin/crystal in the case of stdout #2971

Merged
merged 1 commit into from
Jul 9, 2016

Conversation

RX14
Copy link
Member

@RX14 RX14 commented Jul 9, 2016

As per the cd manpage:

STDOUT
       If a non-empty directory name from CDPATH is used, or if cd − is used, an absolute pathname of the new working directory shall be written to the standard output as follows:

           "%s\n", <new directory>

       Otherwise, there shall be no output.

This means that the cd utility can write it's path to stdout, causing _canonicalize_file_path to contain "/full/dir/path\n/full/dir/path/file", which breaks setting CRYSTAL_PATH.

@asterite
Copy link
Member

asterite commented Jul 9, 2016

Interesting! I didn't know cd had any output.

Thanks!

@asterite asterite merged commit 8e622b1 into crystal-lang:master Jul 9, 2016
@RX14
Copy link
Member Author

RX14 commented Jul 9, 2016

Yeah, it's a very rare case that it does have stdout, I just happen to be the exception to the rule, having CDPATH set!

@asterite asterite added this to the 0.19.0 milestone Jul 22, 2016
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.

None yet

2 participants