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

Use "C" locale for system ping command on Linux #18

Merged
merged 2 commits into from
Dec 29, 2021

Conversation

pekkarr
Copy link
Contributor

@pekkarr pekkarr commented Dec 29, 2021

On GNU/Linux systems the output of the system ping command is often localized, but pingr::ping assumes that the command output contains the English word "time", which causes pingr::ping to fail when using a non-English locale.

This patch passes LC_ALL=C environment variable to ping on Linux systems, which sets the default C locale and ensures that the output is in English.

The problem might also occur on other Unix-like systems, but I cannot test that.

Fixes `pingr::ping()` when system has non-english locale by default
@gaborcsardi
Copy link
Member

Thanks! Can you please add an entry to NEWS.md, referring to this PR and your GH username? Thanks again!

@pekkarr
Copy link
Contributor Author

pekkarr commented Dec 29, 2021

Done!

@gaborcsardi
Copy link
Member

Great, thanks again!

@gaborcsardi gaborcsardi merged commit bfe03f4 into r-lib:main Dec 29, 2021
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