From 751f8e3d78f4de9de9b2bdd202113b462928ddeb Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 5 Oct 2018 18:29:08 +0200 Subject: [PATCH] hostname: Use GetComputerNameW to get hostname. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- po/ar.po | 6 ++++++ po/bg.po | 4 ++++ po/ca.po | 6 ++++++ po/cs.po | 6 ++++++ po/da.po | 6 ++++++ po/de.po | 6 ++++++ po/el.po | 4 ++++ po/en.po | 4 ++++ po/en_US.po | 4 ++++ po/eo.po | 4 ++++ po/es.po | 6 ++++++ po/fa.po | 4 ++++ po/fi.po | 6 ++++++ po/fr.po | 6 ++++++ po/he.po | 6 ++++++ po/hi.po | 4 ++++ po/hr.po | 4 ++++ po/hu.po | 6 ++++++ po/it.po | 6 ++++++ po/ja.po | 6 ++++++ po/ko.po | 6 ++++++ po/lt.po | 6 ++++++ po/ml.po | 4 ++++ po/nb_NO.po | 6 ++++++ po/nl.po | 6 ++++++ po/or.po | 4 ++++ po/pa.po | 4 ++++ po/pl.po | 6 ++++++ po/pt_BR.po | 6 ++++++ po/pt_PT.po | 6 ++++++ po/rm.po | 4 ++++ po/ro.po | 6 ++++++ po/ru.po | 6 ++++++ po/sk.po | 6 ++++++ po/sl.po | 6 ++++++ po/sr_RS@cyrillic.po | 4 ++++ po/sr_RS@latin.po | 4 ++++ po/sv.po | 6 ++++++ po/te.po | 4 ++++ po/th.po | 4 ++++ po/tr.po | 6 ++++++ po/uk.po | 6 ++++++ po/wa.po | 4 ++++ po/wine.pot | 4 ++++ po/zh_CN.po | 6 ++++++ po/zh_TW.po | 6 ++++++ programs/hostname/Makefile.in | 1 - programs/hostname/hostname.c | 31 +++++++++++++------------------ programs/hostname/hostname.h | 3 ++- programs/hostname/hostname.rc | 1 + 50 files changed, 256 insertions(+), 20 deletions(-) diff --git a/po/ar.po b/po/ar.po index 41e501bcc5d..d7ea0b6794f 100644 --- a/po/ar.po +++ b/po/ar.po @@ -11434,6 +11434,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "خطأ: خيار عير سليم '%c'.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "خطأ : لم يتم العثور على العملية \"%1\".\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/bg.po b/po/bg.po index 595de703b09..eb847e498d5 100644 --- a/po/bg.po +++ b/po/bg.po @@ -10923,6 +10923,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/ca.po b/po/ca.po index 9743317d551..f33d2443710 100644 --- a/po/ca.po +++ b/po/ca.po @@ -11182,6 +11182,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Error: L'opció '%c' no és vàlida.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Error: No s'ha pogut trobar el procés \"%1\".\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/cs.po b/po/cs.po index 0dccf362759..cf42fc23e73 100644 --- a/po/cs.po +++ b/po/cs.po @@ -10959,6 +10959,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Chyba: neplatná volba „%c“.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Chyba: Nelze nalézt proces „%1“.\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/da.po b/po/da.po index 8aaa29787d7..61bb522b5b9 100644 --- a/po/da.po +++ b/po/da.po @@ -11347,6 +11347,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Fejl: Ugyldig valgmulighed '%c'.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Fejl: Kunne ikke finde processen «%1».\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/de.po b/po/de.po index 56788619ac2..52932ad70cd 100644 --- a/po/de.po +++ b/po/de.po @@ -11135,6 +11135,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Fehler: Ungültige Option '%c'.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Fehler: Prozess \"%1\" konnte nicht gefunden werden.\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/el.po b/po/el.po index ac68b44730b..d15b90eab48 100644 --- a/po/el.po +++ b/po/el.po @@ -10726,6 +10726,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/en.po b/po/en.po index e982343074a..8aa6adfb8cc 100644 --- a/po/en.po +++ b/po/en.po @@ -11054,6 +11054,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Error: Invalid option '%c'.\n" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "Error: Could not get hostname: %u.\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/en_US.po b/po/en_US.po index fd6e1fa23d1..a291ef1b51f 100644 --- a/po/en_US.po +++ b/po/en_US.po @@ -11054,6 +11054,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Error: Invalid option '%c'.\n" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "Error: Could not get hostname: %u.\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/eo.po b/po/eo.po index 6762ebfd1b5..c3cd7bf2d25 100644 --- a/po/eo.po +++ b/po/eo.po @@ -10677,6 +10677,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/es.po b/po/es.po index df22d0e76bd..cd4e7753e7e 100644 --- a/po/es.po +++ b/po/es.po @@ -11419,6 +11419,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Error: Opción '%c' inválida.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Error: No se pudo encontrar el proceso \"%1\".\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/fa.po b/po/fa.po index 7b625ce8c33..2702b0ff2d9 100644 --- a/po/fa.po +++ b/po/fa.po @@ -10711,6 +10711,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/fi.po b/po/fi.po index 2a837d6c061..daac97ef5d0 100644 --- a/po/fi.po +++ b/po/fi.po @@ -11032,6 +11032,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Virhe: Virheellinen valinta '%c'.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Virhe: Prosessia \"%1\" ei löytynyt.\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/fr.po b/po/fr.po index 51be67eb19c..8a99e0f5283 100644 --- a/po/fr.po +++ b/po/fr.po @@ -11320,6 +11320,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Erreur : option « %c » invalide.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Erreur : processus « %1 » introuvable.\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/he.po b/po/he.po index 2a0fef4e40f..69b34af3e11 100644 --- a/po/he.po +++ b/po/he.po @@ -11114,6 +11114,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Error: Invalid option '%c'.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Error: Could not find process \"%1\".\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/hi.po b/po/hi.po index a9f6a98f114..1d3bb90e5c7 100644 --- a/po/hi.po +++ b/po/hi.po @@ -10537,6 +10537,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/hr.po b/po/hr.po index 59d3d5ab2b4..a1eb303b87b 100644 --- a/po/hr.po +++ b/po/hr.po @@ -10905,6 +10905,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Greška: Neispravna opcija '%c'.\n" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/hu.po b/po/hu.po index 19a0657aedf..30f1b261ffc 100644 --- a/po/hu.po +++ b/po/hu.po @@ -11338,6 +11338,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Hiba: Érvénytelen opció '%c'.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Hiba: A \"%1\" folyamat nem található.\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/it.po b/po/it.po index 9f00bed1536..e26e12a9798 100644 --- a/po/it.po +++ b/po/it.po @@ -11420,6 +11420,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Errore: opzione non valida '%c'.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Errore: processo non trovato \"%1\".\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/ja.po b/po/ja.po index 6688652893a..c7d60908545 100644 --- a/po/ja.po +++ b/po/ja.po @@ -11041,6 +11041,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "エラー: 無効なオプション '%c'。\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "エラー: プロセス(%1)が見つかりません。\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/ko.po b/po/ko.po index d0c0143be67..df19b4d322d 100644 --- a/po/ko.po +++ b/po/ko.po @@ -11232,6 +11232,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "오류: 올바르지 않은 옵션 '%c'.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "오류: 프로세스 \"%1\"를 찾을 수 없습니다.\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/lt.po b/po/lt.po index 5605ef0abad..e0c97c27896 100644 --- a/po/lt.po +++ b/po/lt.po @@ -11060,6 +11060,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Klaida: netinkamas parametras „%c“.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Klaida: nepavyko rasti proceso „%1“.\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/ml.po b/po/ml.po index d23dc606143..2eab3fb6036 100644 --- a/po/ml.po +++ b/po/ml.po @@ -10537,6 +10537,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/nb_NO.po b/po/nb_NO.po index 3dccf8478ad..9f82b1f4604 100644 --- a/po/nb_NO.po +++ b/po/nb_NO.po @@ -11054,6 +11054,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Feil: \"%c\" er et ugyldig valg.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Feil: Klarte ikke finne prosessen \"%1\".\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/nl.po b/po/nl.po index dc0378dcae3..de042654897 100644 --- a/po/nl.po +++ b/po/nl.po @@ -11383,6 +11383,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Fout: Ongeldige optie '%c'.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Fout: Kon proces \"%1\" niet vinden.\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/or.po b/po/or.po index 07f5fa5fa8b..03ea3ab362e 100644 --- a/po/or.po +++ b/po/or.po @@ -10537,6 +10537,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/pa.po b/po/pa.po index 287beccd7c4..6d91992b630 100644 --- a/po/pa.po +++ b/po/pa.po @@ -10537,6 +10537,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/pl.po b/po/pl.po index 2f95e6d1d39..336f1667a22 100644 --- a/po/pl.po +++ b/po/pl.po @@ -11126,6 +11126,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Błąd: Nieprawidłowa opcja '%c'.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Błąd: Nie można znaleźć procesu \"%1\".\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/pt_BR.po b/po/pt_BR.po index 90d07cdf6b2..9f85ffa119a 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -11251,6 +11251,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Erro: Opção inválida '%c'.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Erro: Não foi possível encontrar o processo \"%1\".\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/pt_PT.po b/po/pt_PT.po index a993395ac5f..e4b5f6ffae5 100644 --- a/po/pt_PT.po +++ b/po/pt_PT.po @@ -11097,6 +11097,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Erro: opção inválida '%c'.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Erro: Incapaz de encontrar o processo \"%1\".\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/rm.po b/po/rm.po index ee6ed226b5b..3d3ee465239 100644 --- a/po/rm.po +++ b/po/rm.po @@ -10618,6 +10618,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/ro.po b/po/ro.po index d6e1f7f2a50..9eb7b4ac73a 100644 --- a/po/ro.po +++ b/po/ro.po @@ -11204,6 +11204,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Eroare: Opțiune nevalidă „%c”.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Eroare: Procesul „%1” nu a putut fi găsit.\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/ru.po b/po/ru.po index 0605373026e..caa6050e0d7 100644 --- a/po/ru.po +++ b/po/ru.po @@ -11055,6 +11055,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Ошибка: неверная опция «%c».\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Ошибка: не удалось найти Процесс «%1».\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/sk.po b/po/sk.po index 3027a310d82..a1eb84a6873 100644 --- a/po/sk.po +++ b/po/sk.po @@ -10813,6 +10813,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Chyba: Nemôžno nájsť proces \"%1\".\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/sl.po b/po/sl.po index c330b67d89e..fda3b13210d 100644 --- a/po/sl.po +++ b/po/sl.po @@ -11369,6 +11369,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Napaka: neveljavna možnost '%c'.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Napaka: ni mogoče najti opravila \"%1\".\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/sr_RS@cyrillic.po b/po/sr_RS@cyrillic.po index 0eafe2f8560..17a3b0ebf98 100644 --- a/po/sr_RS@cyrillic.po +++ b/po/sr_RS@cyrillic.po @@ -11153,6 +11153,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Неисправна синтакса" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/sr_RS@latin.po b/po/sr_RS@latin.po index 18d736450c1..df2c91ae9a1 100644 --- a/po/sr_RS@latin.po +++ b/po/sr_RS@latin.po @@ -11275,6 +11275,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Neispravna sintaksa" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/sv.po b/po/sv.po index 3a37b9fc31b..a21a8b154e1 100644 --- a/po/sv.po +++ b/po/sv.po @@ -11089,6 +11089,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Fel: Flaggan '%c' är ogiltig.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Fel: Kunde inte hitta processen \"%1\".\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/te.po b/po/te.po index a15bc33a733..febeb84e290 100644 --- a/po/te.po +++ b/po/te.po @@ -10537,6 +10537,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/th.po b/po/th.po index 269e3d06a28..60b266b4f9d 100644 --- a/po/th.po +++ b/po/th.po @@ -10757,6 +10757,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/tr.po b/po/tr.po index 51b3b018449..85212a167e2 100644 --- a/po/tr.po +++ b/po/tr.po @@ -11105,6 +11105,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Hata: '%c' geçersiz seçenek.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Hata: \"%1\" işlemi bulunamıyor.\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/uk.po b/po/uk.po index 9a7a25b2e77..0e061dae1d3 100644 --- a/po/uk.po +++ b/po/uk.po @@ -11132,6 +11132,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "Помилка: невірний параметр '%c'.\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "Помилка: Не вдалось знайти процес \"%1\".\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/wa.po b/po/wa.po index d711cf1f0cb..aec1217ee29 100644 --- a/po/wa.po +++ b/po/wa.po @@ -10682,6 +10682,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/wine.pot b/po/wine.pot index c6fb36106c6..b07d3782919 100644 --- a/po/wine.pot +++ b/po/wine.pot @@ -10470,6 +10470,10 @@ msgid "Error: Invalid option '%c'.\n" msgstr "" #: hostname.rc:32 +msgid "Error: Could not get hostname: %u.\n" +msgstr "" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/zh_CN.po b/po/zh_CN.po index 95a95f0de0b..9051fc2e6da 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -10847,6 +10847,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "错误:无效的选项 '%c'。\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "错误:找不到进程 \"%1\"。\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/po/zh_TW.po b/po/zh_TW.po index 551182a69ce..d3eec87bba5 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -11344,6 +11344,12 @@ msgid "Error: Invalid option '%c'.\n" msgstr "錯誤:無效的選項 %c。\n" #: hostname.rc:32 +#, fuzzy +#| msgid "Error: Could not find process \"%1\".\n" +msgid "Error: Could not get hostname: %u.\n" +msgstr "錯誤:找不到行程 %1。\n" + +#: hostname.rc:33 msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" diff --git a/programs/hostname/Makefile.in b/programs/hostname/Makefile.in index 5b50a5a8af3..e1a2487451e 100644 --- a/programs/hostname/Makefile.in +++ b/programs/hostname/Makefile.in @@ -1,6 +1,5 @@ MODULE = hostname.exe APPMODE = -mconsole -municode -EXTRALIBS = $(SOCKET_LIBS) DELAYIMPORTS = user32 C_SRCS = hostname.c diff --git a/programs/hostname/hostname.c b/programs/hostname/hostname.c index 3e1f2bdda32..e3abc1684c8 100644 --- a/programs/hostname/hostname.c +++ b/programs/hostname/hostname.c @@ -19,16 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include -#if defined(__MINGW32__) || defined (_MSC_VER) -#include -#elif defined(HAVE_UNISTD_H) -#include -#endif - #include #include #include @@ -109,17 +100,23 @@ static int hostname_message(int msg) return hostname_printfW(formatW, msg_buffer); } -static void display_computer_name(void) +static int display_computer_name(void) { static const WCHAR fmtW[] = {'%','s','\r','\n',0}; - char nameA[256]; - WCHAR nameW[256]; + WCHAR name[MAX_COMPUTERNAME_LENGTH + 1]; + DWORD size = ARRAY_SIZE(name); + BOOL ret; - gethostname(nameA, sizeof(nameA)); - MultiByteToWideChar(CP_UNIXCP, 0, nameA, sizeof(nameA), nameW, ARRAY_SIZE(nameW)); + ret = GetComputerNameW(name, &size); + if (!ret) + { + hostname_message_printfW(STRING_CANNOT_GET_HOSTNAME, GetLastError()); + return 1; + } - hostname_printfW(fmtW, nameW); + hostname_printfW(fmtW, name); + return 0; } int wmain(int argc, WCHAR *argv[]) @@ -163,7 +160,5 @@ int wmain(int argc, WCHAR *argv[]) } } - display_computer_name(); - - return 0; + return display_computer_name(); } diff --git a/programs/hostname/hostname.h b/programs/hostname/hostname.h index 8d5fcfc00c1..6b8d2b2727e 100644 --- a/programs/hostname/hostname.h +++ b/programs/hostname/hostname.h @@ -23,4 +23,5 @@ /* Translation IDs. */ #define STRING_USAGE 101 #define STRING_INVALID_OPTION 102 -#define STRING_CANNOT_SET_HOSTNAME 103 +#define STRING_CANNOT_GET_HOSTNAME 103 +#define STRING_CANNOT_SET_HOSTNAME 104 diff --git a/programs/hostname/hostname.rc b/programs/hostname/hostname.rc index 182584fbd0d..3f72d1cabc1 100644 --- a/programs/hostname/hostname.rc +++ b/programs/hostname/hostname.rc @@ -28,5 +28,6 @@ STRINGTABLE { STRING_USAGE, "Usage: hostname\n" STRING_INVALID_OPTION, "Error: Invalid option '%c'.\n" + STRING_CANNOT_GET_HOSTNAME, "Error: Could not get hostname: %u.\n" STRING_CANNOT_SET_HOSTNAME, "Error: Setting the system hostname is not possible with the hostname utility.\n" }