diff options
| author | Joakim Nohlgård <joakim@nohlgard.se> | 2022-12-16 07:38:37 +0000 |
|---|---|---|
| committer | Joakim Nohlgård <joakim@nohlgard.se> | 2022-12-16 07:38:37 +0000 |
| commit | 7bb5c80d04be5e5297fb6259e487fe0105e85935 (patch) | |
| tree | 0ba2cb4faa6b59138212fa811d173f0d95eb2716 /main.c | |
| parent | doc: foot-ctlseq: expand last column to fill screen in all tables (diff) | |
main: Graceful fallback if user has configured an invalid locale
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -433,8 +433,13 @@ main(int argc, char *const *argv) const char *locale = setlocale(LC_CTYPE, ""); if (locale == NULL) { - LOG_ERR("setlocale() failed"); - return ret; + /* + * If the user has configured an invalid locale, or a name of a locale + * that does not exist on this system, then the above call may return + * NULL. We should just continue with the fallback method below. + */ + LOG_WARN("setlocale() failed"); + locale = "C"; } LOG_INFO("locale: %s", locale); |
