diff --git a/ChangeLog.adoc b/ChangeLog.adoc index d3f0cda83..6b188455f 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.1.1]] diff --git a/po/cs.po b/po/cs.po index b4c723c30..711619aa1 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-10-19 23:54+0200\n" +"POT-Creation-Date: 2023-10-30 23:26+0100\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -4708,6 +4708,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 1abc8b82d..0f85569f1 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-10-19 23:54+0200\n" +"POT-Creation-Date: 2023-10-30 23:26+0100\n" "PO-Revision-Date: 2023-10-11 07:51+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -5918,6 +5918,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 289d27f55..dabaf5deb 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-10-19 23:54+0200\n" +"POT-Creation-Date: 2023-10-30 23:26+0100\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Santiago Forero \n" "Language-Team: weechat-dev \n" @@ -5341,6 +5341,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 f5a0154c4..0034874df 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-10-19 23:54+0200\n" -"PO-Revision-Date: 2023-10-19 23:56+0200\n" +"POT-Creation-Date: 2023-10-30 23:26+0100\n" +"PO-Revision-Date: 2023-10-30 23:27+0100\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -5788,6 +5788,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 6932db759..890286a8f 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-10-19 23:54+0200\n" +"POT-Creation-Date: 2023-10-30 23:26+0100\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -4236,6 +4236,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 f7ac61ab9..33545ecc5 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-10-19 23:54+0200\n" +"POT-Creation-Date: 2023-10-30 23:26+0100\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -4977,6 +4977,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 d6a89273b..276a0bd76 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-10-19 23:54+0200\n" +"POT-Creation-Date: 2023-10-30 23:26+0100\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: Polish \n" @@ -6198,6 +6198,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 8793b2326..483be6b4c 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-10-19 23:54+0200\n" +"POT-Creation-Date: 2023-10-30 23:26+0100\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -5615,6 +5615,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 dcb371d46..d84d330bd 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-10-19 23:54+0200\n" +"POT-Creation-Date: 2023-10-30 23:26+0100\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -4981,6 +4981,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 837178e29..fa48b68fd 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-10-19 23:54+0200\n" +"POT-Creation-Date: 2023-10-30 23:26+0100\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -4266,6 +4266,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 6d4b7d28d..637892a25 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-10-19 23:54+0200\n" +"POT-Creation-Date: 2023-10-30 23:26+0100\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -5706,6 +5706,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 705a39294..550808095 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-10-19 23:54+0200\n" +"POT-Creation-Date: 2023-10-30 23:26+0100\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -5758,6 +5758,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 bf667767b..15705c9ff 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-10-19 23:54+0200\n" +"POT-Creation-Date: 2023-10-30 23:26+0100\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -3882,6 +3882,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 d05280861..969749b0e 100644 --- a/src/core/wee-dir.c +++ b/src/core/wee-dir.c @@ -442,6 +442,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"); @@ -462,7 +465,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]) @@ -480,7 +483,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]) @@ -497,7 +500,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]) @@ -512,10 +515,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) { @@ -537,7 +549,6 @@ error: free (*runtime_dir); *runtime_dir = NULL; } - string_fprintf (stderr, _("Error: not enough memory\n")); return 0; }