diff --git a/ChangeLog.adoc b/ChangeLog.adoc index a104cee90..d4b318fd7 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -15,6 +15,7 @@ For a list of important changes that require manual actions, please look at rele Bug fixes:: + * core: display an error on startup if environment variable "HOME" is not set * ruby: fix use of NULL variable when displaying exception [[v4.0.6]] diff --git a/po/cs.po b/po/cs.po index c9509ce57..f1e45ac5e 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-14 20:21+0200\n" +"POT-Creation-Date: 2023-10-30 23:09+0100\n" "PO-Revision-Date: 2023-06-25 00:48+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -4538,6 +4538,11 @@ msgid "" "Error: unable to create a temporary home directory (using template: \"%s\")\n" msgstr "%s%s: nemohu vytvořit adresář pro logy (\"%s\")" +#, fuzzy +#| msgid "Environment variable \"%s\" is not defined" +msgid "Error: environment variable \"HOME\" is not defined\n" +msgstr "Proměnná prostředí \"%s\" není definována" + #, fuzzy, c-format msgid "Error: \"%s\" is not a directory\n" msgstr "Chyba: domovský adresář (%s) není adresářem\n" diff --git a/po/de.po b/po/de.po index 84d90dfa0..9db6ab1eb 100644 --- a/po/de.po +++ b/po/de.po @@ -26,7 +26,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-14 20:21+0200\n" +"POT-Creation-Date: 2023-10-30 23:09+0100\n" "PO-Revision-Date: 2023-07-05 21:25+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -5709,6 +5709,11 @@ msgstr "" "Fehler: es kann kein temporäres Heimatverzeichnis angelegt werden (mit " "Befehl: \"%s\")\n" +#, fuzzy +#| msgid "Environment variable \"%s\" is not defined" +msgid "Error: environment variable \"HOME\" is not defined\n" +msgstr "Umgebungsvariable \"%s\" ist nicht definiert" + #, c-format msgid "Error: \"%s\" is not a directory\n" msgstr "Fehler: \"%s\" ist kein Verzeichnis\n" diff --git a/po/es.po b/po/es.po index 1ba743353..2c09913f2 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-14 20:21+0200\n" +"POT-Creation-Date: 2023-10-30 23:09+0100\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: Santiago Forero \n" "Language-Team: weechat-dev \n" @@ -5163,6 +5163,11 @@ msgid "" "Error: unable to create a temporary home directory (using template: \"%s\")\n" msgstr "%s%s: imposible crear directorio para registros (\"%s\")" +#, fuzzy +#| msgid "Environment variable \"%s\" is not defined" +msgid "Error: environment variable \"HOME\" is not defined\n" +msgstr "Variable \"%s\" no definida" + #, fuzzy, c-format msgid "Error: \"%s\" is not a directory\n" msgstr "Error: home (%s) no es un directorio\n" diff --git a/po/fr.po b/po/fr.po index a7c951876..7e7eac25a 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-14 20:21+0200\n" -"PO-Revision-Date: 2023-09-14 20:21+0200\n" +"POT-Creation-Date: 2023-10-30 23:09+0100\n" +"PO-Revision-Date: 2023-10-30 23:23+0100\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -5577,6 +5577,9 @@ msgstr "" "Erreur : impossible de créer le répertoire de base temporaire (en utilisant " "le modèle : \"%s\")\n" +msgid "Error: environment variable \"HOME\" is not defined\n" +msgstr "Erreur : la variable d'environnement \"HOME\" n'est pas définie\n" + #, c-format msgid "Error: \"%s\" is not a directory\n" msgstr "Erreur : \"%s\" n'est pas un répertoire\n" diff --git a/po/hu.po b/po/hu.po index 606af7052..7e094b259 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-14 20:21+0200\n" +"POT-Creation-Date: 2023-10-30 23:09+0100\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -4080,6 +4080,10 @@ msgid "" "Error: unable to create a temporary home directory (using template: \"%s\")\n" msgstr "%s nem sikerült a szervert létrehozni\n" +#, fuzzy +msgid "Error: environment variable \"HOME\" is not defined\n" +msgstr " . típus: szám\n" + #, fuzzy, c-format msgid "Error: \"%s\" is not a directory\n" msgstr "%s nem sikerült a \"%s\" könyvtárat létrehozni\n" diff --git a/po/it.po b/po/it.po index 1c515ef96..bc36266db 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-14 20:21+0200\n" +"POT-Creation-Date: 2023-10-30 23:09+0100\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -4800,6 +4800,10 @@ msgid "" "Error: unable to create a temporary home directory (using template: \"%s\")\n" msgstr "%s%s: impossibile creare la directory per i log (\"%s\")" +#, fuzzy +msgid "Error: environment variable \"HOME\" is not defined\n" +msgstr "Variabili" + #, fuzzy, c-format msgid "Error: \"%s\" is not a directory\n" msgstr "Errore: home (%s) non è una directory\n" diff --git a/po/ja.po b/po/ja.po index 22fd90d4c..c8335f4eb 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-14 20:21+0200\n" +"POT-Creation-Date: 2023-10-30 23:09+0100\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: Polish \n" @@ -5850,6 +5850,11 @@ msgstr "" "Błąd: nie można utworzyć tymczasowego katalogu domowego (używając szablonu: " "\"%s\")\n" +#, fuzzy +#| msgid "Environment variable \"%s\" is not defined" +msgid "Error: environment variable \"HOME\" is not defined\n" +msgstr "Zmienna środowiskowa \"%s\" nie jest zdefiniowana" + #, c-format msgid "Error: \"%s\" is not a directory\n" msgstr "Błąd: „%s” nie jest katalogiem\n" diff --git a/po/pt.po b/po/pt.po index e84a20bc8..99977c896 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-14 20:21+0200\n" +"POT-Creation-Date: 2023-10-30 23:09+0100\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -5437,6 +5437,11 @@ msgid "" "Error: unable to create a temporary home directory (using template: \"%s\")\n" msgstr "%s%s: não foi possível criar diretório para registos (\"%s\")" +#, fuzzy +#| msgid "Environment variable \"%s\" is not defined" +msgid "Error: environment variable \"HOME\" is not defined\n" +msgstr "A variável de ambiente \"%s\" não está definida" + #, fuzzy, c-format msgid "Error: \"%s\" is not a directory\n" msgstr "Erro: a base (%s) não é um diretório\n" diff --git a/po/pt_BR.po b/po/pt_BR.po index a57139258..c02520c0d 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-14 20:21+0200\n" +"POT-Creation-Date: 2023-10-30 23:09+0100\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -4807,6 +4807,10 @@ msgid "" "Error: unable to create a temporary home directory (using template: \"%s\")\n" msgstr "%s%s: não foi possível criar diretório para registros (\"%s\")" +#, fuzzy +msgid "Error: environment variable \"HOME\" is not defined\n" +msgstr "Variáveis" + #, fuzzy, c-format msgid "Error: \"%s\" is not a directory\n" msgstr "Erro: (%s) não é um diretório\n" diff --git a/po/ru.po b/po/ru.po index ae9de94ab..2a4f6cde6 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-14 20:21+0200\n" +"POT-Creation-Date: 2023-10-30 23:09+0100\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -4108,6 +4108,10 @@ msgid "" "Error: unable to create a temporary home directory (using template: \"%s\")\n" msgstr "%s не могу создать сервер \"%s\"\n" +#, fuzzy +msgid "Error: environment variable \"HOME\" is not defined\n" +msgstr " . тип: целочисленный\n" + #, fuzzy, c-format msgid "Error: \"%s\" is not a directory\n" msgstr "%s домашний каталог (%s) не является директорией\n" diff --git a/po/sr.po b/po/sr.po index b5d8a1f21..8028a27a0 100644 --- a/po/sr.po +++ b/po/sr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-14 20:21+0200\n" +"POT-Creation-Date: 2023-10-30 23:09+0100\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -5504,6 +5504,11 @@ msgstr "" "Грешка: не може да се креира привремени почетни директоријум (користећи " "шаблон: \"%s\")\n" +#, fuzzy +#| msgid "Environment variable \"%s\" is not defined" +msgid "Error: environment variable \"HOME\" is not defined\n" +msgstr "Није дефинисана променљива окружења „%s”" + #, c-format msgid "Error: \"%s\" is not a directory\n" msgstr "Грешка: „%s” није директоријум\n" diff --git a/po/tr.po b/po/tr.po index a084e60d7..453c41df7 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-14 20:21+0200\n" +"POT-Creation-Date: 2023-10-30 23:09+0100\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -5488,6 +5488,11 @@ msgid "" msgstr "" "Hata: Geçici bir ev dizini oluşturulamıyor (kullanılan şablon: \"%s\")\n" +#, fuzzy +#| msgid "Environment variable \"%s\" is not defined" +msgid "Error: environment variable \"HOME\" is not defined\n" +msgstr "Ortam değişkeni \"%s\" tanımlanmamış" + #, c-format msgid "Error: \"%s\" is not a directory\n" msgstr "Hata: \"%s\" bir dizin değil\n" diff --git a/po/weechat.pot b/po/weechat.pot index 93b5c1792..3aa7b6888 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-14 20:21+0200\n" +"POT-Creation-Date: 2023-10-30 23:09+0100\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -3730,6 +3730,9 @@ msgid "" "Error: unable to create a temporary home directory (using template: \"%s\")\n" msgstr "" +msgid "Error: environment variable \"HOME\" is not defined\n" +msgstr "" + #, c-format msgid "Error: \"%s\" is not a directory\n" msgstr "" diff --git a/src/core/wee-dir.c b/src/core/wee-dir.c index bd1252616..a1ef14457 100644 --- a/src/core/wee-dir.c +++ b/src/core/wee-dir.c @@ -440,6 +440,9 @@ dir_find_xdg_dirs (char **config_dir, char **data_dir, char **cache_dir, *runtime_dir = NULL; ptr_home = getenv ("HOME"); + if (!ptr_home) + goto error_home; + xdg_config_home = getenv ("XDG_CONFIG_HOME"); xdg_data_home = getenv ("XDG_DATA_HOME"); xdg_cache_home = getenv ("XDG_CACHE_HOME"); @@ -460,7 +463,7 @@ dir_find_xdg_dirs (char **config_dir, char **data_dir, char **cache_dir, } *config_dir = strdup (path); if (!*config_dir) - goto error; + goto error_memory; /* set data dir: $XDG_DATA_HOME/weechat or $HOME/.local/share/weechat */ if (xdg_data_home && xdg_data_home[0]) @@ -478,7 +481,7 @@ dir_find_xdg_dirs (char **config_dir, char **data_dir, char **cache_dir, } *data_dir = strdup (path); if (!*data_dir) - goto error; + goto error_memory; /* set cache dir: $XDG_CACHE_HOME/weechat or $HOME/.cache/weechat */ if (xdg_cache_home && xdg_cache_home[0]) @@ -495,7 +498,7 @@ dir_find_xdg_dirs (char **config_dir, char **data_dir, char **cache_dir, } *cache_dir = strdup (path); if (!*cache_dir) - goto error; + goto error_memory; /* set runtime dir: $XDG_RUNTIME_DIR/weechat or same as cache dir */ if (xdg_runtime_dir && xdg_runtime_dir[0]) @@ -510,10 +513,19 @@ dir_find_xdg_dirs (char **config_dir, char **data_dir, char **cache_dir, *runtime_dir = strdup (*cache_dir); } if (!*runtime_dir) - goto error; + goto error_memory; return 1; +error_home: + string_fprintf (stderr, + _("Error: environment variable \"HOME\" is not defined\n")); + goto error; + +error_memory: + string_fprintf (stderr, _("Error: not enough memory\n")); + goto error; + error: if (*config_dir) { @@ -535,7 +547,6 @@ error: free (*runtime_dir); *runtime_dir = NULL; } - string_fprintf (stderr, _("Error: not enough memory\n")); return 0; }