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

Do not exit if locale settings are broken #343

Merged
merged 1 commit into from
Apr 16, 2020

Conversation

avdv
Copy link
Collaborator

@avdv avdv commented Feb 8, 2020

Description

There were a few reports about colorls error-out with broken locale settings (especially on OSX).

To crash is rather extreme, if nothing bad can happen if calling setlocale fails. It's just sorting the filenames will happen to use the C locale rules.

Simply warning the user that something bad has happened and carry on.

@avdv avdv changed the title Rescue setlocale Do not exit if locale settings are broken Feb 8, 2020
@codecov-io
Copy link

codecov-io commented Feb 8, 2020

Codecov Report

Merging #343 into master will increase coverage by 0.04%.
The diff coverage is 30%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #343      +/-   ##
=========================================
+ Coverage   88.75%   88.8%   +0.04%     
=========================================
  Files           8       8              
  Lines         498     500       +2     
=========================================
+ Hits          442     444       +2     
  Misses         56      56
Impacted Files Coverage Δ
lib/colorls/core.rb 90.23% <0%> (+0.83%) ⬆️
lib/colorls/git.rb 75% <0%> (-2.78%) ⬇️
lib/colorls/flags.rb 86.77% <75%> (-0.52%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5640a6e...dbf23ca. Read the comment docs.

@avdv avdv force-pushed the rescue-setlocale branch 2 times, most recently from 4fb29b0 to 8a675e4 Compare April 16, 2020 22:18
Keep running if calling `setlocale` fails, because of invalid locale settings.

Fixes athityakumar#335.
@avdv avdv merged commit 9c37fb2 into athityakumar:master Apr 16, 2020
@avdv avdv deleted the rescue-setlocale branch April 16, 2020 22:31
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