From 49f384727bb54db10e4b13b6117f64d36484dfbf Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Sun, 3 Dec 2017 06:50:15 +0000 Subject: [PATCH] reg: Prompt the user to overwrite the export file if it already exists. Signed-off-by: Hugh McMaster Signed-off-by: Alexandre Julliard --- po/ar.po | 6 ++++++ po/bg.po | 7 +++++++ po/ca.po | 6 ++++++ po/cs.po | 6 ++++++ po/da.po | 6 ++++++ po/de.po | 6 ++++++ po/el.po | 7 +++++++ po/en.po | 4 ++++ po/en_US.po | 4 ++++ po/eo.po | 6 ++++++ po/es.po | 6 ++++++ po/fa.po | 8 +++++++ po/fi.po | 6 ++++++ po/fr.po | 6 ++++++ po/he.po | 7 +++++++ po/hi.po | 4 ++++ po/hr.po | 6 ++++++ 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 | 10 +++++++++ po/sl.po | 6 ++++++ po/sr_RS@cyrillic.po | 7 +++++++ po/sr_RS@latin.po | 7 +++++++ po/sv.po | 6 ++++++ po/te.po | 4 ++++ po/th.po | 12 +++++++++++ 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/reg/export.c | 45 +++++++++++++++++++++++++++++++++++++++- programs/reg/reg.c | 4 ++-- programs/reg/reg.h | 2 ++ programs/reg/reg.rc | 1 + programs/reg/resource.h | 1 + programs/reg/tests/reg.c | 18 ++++++++-------- 52 files changed, 332 insertions(+), 12 deletions(-) diff --git a/po/ar.po b/po/ar.po index 62399c5e251..30d7bb6bf53 100644 --- a/po/ar.po +++ b/po/ar.po @@ -12546,6 +12546,12 @@ msgstr "REG QUERY اسم المفتاح [/v اسم القيمة | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "خطأ : اسم المفتاح غير سليم\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The specified file already exists. Do you want to replace it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "الملف المحدد موجود بالفعل ، هل ترغب باستبداله ؟" + #: regedit.rc:34 msgid "&Registry" msgstr "ال&سجل" diff --git a/po/bg.po b/po/bg.po index 180bf6fd205..749fb745a40 100644 --- a/po/bg.po +++ b/po/bg.po @@ -12070,6 +12070,13 @@ msgstr "" msgid "reg: Invalid system key [%1]\n" msgstr "Невалидни знаци в пътя.\n" +#: reg.rc:72 +#, fuzzy +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "" +"Файлът вече съществува.\n" +"Искате ли да го замените?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Регистър" diff --git a/po/ca.po b/po/ca.po index f93a56b3646..b5bd56fb97a 100644 --- a/po/ca.po +++ b/po/ca.po @@ -12410,6 +12410,12 @@ msgstr "REG QUERY nom_de_clau [/v nom_de_valor | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "reg: Nom de clau invàlid\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The registry value '%1' already exists. Do you want to overwrite it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "El valor de registre '%1' ja existeix. El voleu sobreescriure?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registre" diff --git a/po/cs.po b/po/cs.po index 0feb63a87df..e0421ae6ce7 100644 --- a/po/cs.po +++ b/po/cs.po @@ -12194,6 +12194,12 @@ msgstr "REG QUERY název_klíče [/v název_hodnoty | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "Chyba: Neplatný název klíče\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The specified file already exists. Do you want to replace it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "Soubor již existuje. Chcete jej nahradit?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registr" diff --git a/po/da.po b/po/da.po index 79b81623641..426b4a9f2e0 100644 --- a/po/da.po +++ b/po/da.po @@ -12501,6 +12501,12 @@ msgstr "REG QUERY nøgle_navn [/v værdi | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "Fejl: Ugyldigt nøgle navn\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The specified file already exists. Do you want to replace it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "Filen findes allerede. Vil du erstatte den?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Register" diff --git a/po/de.po b/po/de.po index a67aecba285..1cddd088a27 100644 --- a/po/de.po +++ b/po/de.po @@ -12273,6 +12273,12 @@ msgstr "REG IMPORT datei.reg\n" msgid "reg: Invalid system key [%1]\n" msgstr "regedit: Ungültiger Systemschlüssel [%1]\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The registry value '%1' already exists. Do you want to overwrite it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "Der Wert '%1' existiert bereits. Möchten Sie ihn ersetzen?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registrierung" diff --git a/po/el.po b/po/el.po index 14b4f7faeab..bb312bdeff8 100644 --- a/po/el.po +++ b/po/el.po @@ -11835,6 +11835,13 @@ msgstr "" msgid "reg: Invalid system key [%1]\n" msgstr "Μη έγγυρος(οι) χαρακτήρας(ες) στο μονοπάτι.\n" +#: reg.rc:72 +#, fuzzy +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "" +"Το αρχείο υπάρχει ήδη.\n" +"Θέλετε να το αντικαταστήσετε;" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/en.po b/po/en.po index 009b0bdf4e8..30bdec9e71d 100644 --- a/po/en.po +++ b/po/en.po @@ -12180,6 +12180,10 @@ msgstr "REG EXPORT key_name file.reg [/y]\n" msgid "reg: Invalid system key [%1]\n" msgstr "reg: Invalid system key [%1]\n" +#: reg.rc:72 +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "The file '%1' already exists. Do you want to overwrite it?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registry" diff --git a/po/en_US.po b/po/en_US.po index 8391ce4109b..f1bed71bfc4 100644 --- a/po/en_US.po +++ b/po/en_US.po @@ -12180,6 +12180,10 @@ msgstr "REG EXPORT key_name file.reg [/y]\n" msgid "reg: Invalid system key [%1]\n" msgstr "reg: Invalid system key [%1]\n" +#: reg.rc:72 +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "The file '%1' already exists. Do you want to overwrite it?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registry" diff --git a/po/eo.po b/po/eo.po index 0d67a4398e6..9b46f0c9167 100644 --- a/po/eo.po +++ b/po/eo.po @@ -11781,6 +11781,12 @@ msgstr "" msgid "reg: Invalid system key [%1]\n" msgstr "Nevalida nomo de kunuzata aparato.\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The specified file already exists. Do you want to replace it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "Dosiero estas jam ekzistanta. Ĉu vi volas anstataŭi ĝin?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registrejo" diff --git a/po/es.po b/po/es.po index 44bb5d1cd2b..91c44f057e9 100644 --- a/po/es.po +++ b/po/es.po @@ -12580,6 +12580,12 @@ msgstr "REG QUERY nombre_clave [/v nombre_valor | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "Error: nombre de clave inválido\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The specified file already exists. Do you want to replace it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "El archivo ya existe. ¿Desea reemplazarlo?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registro" diff --git a/po/fa.po b/po/fa.po index 39a6bf6efbc..503060c159d 100644 --- a/po/fa.po +++ b/po/fa.po @@ -11819,6 +11819,14 @@ msgstr "" msgid "reg: Invalid system key [%1]\n" msgstr "" +#: reg.rc:72 +#, fuzzy +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "" +"پرونده‌ای با نام '%s' وجود ندارد.\n" +"\n" +"آیا می‌خواهید یک پرونده‌ی جدید ایجاد کنید؟" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/fi.po b/po/fi.po index 59c3eea9643..34d39aae13b 100644 --- a/po/fi.po +++ b/po/fi.po @@ -12174,6 +12174,12 @@ msgstr "REG IMPORT tiedosto.reg\n" msgid "reg: Invalid system key [%1]\n" msgstr "regedit: Järjestelmäavain [%1] ei kelpaa\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The registry value '%1' already exists. Do you want to overwrite it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "Rekisterin arvo '%1' on jo olemassa. Haluatko korvata sen?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Rekisteri" diff --git a/po/fr.po b/po/fr.po index 1457f136c3f..b02556866f6 100644 --- a/po/fr.po +++ b/po/fr.po @@ -12453,6 +12453,12 @@ msgstr "REG QUERY nom_de_clé [/v nom_de_valeur | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "reg : nom de clé invalide\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The registry value '%1' already exists. Do you want to overwrite it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "La valeur de registre « %1 » existe déjà. Voulez-vous la remplacer ?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registre" diff --git a/po/he.po b/po/he.po index 1e7e2b9b6ac..30f9d6a0714 100644 --- a/po/he.po +++ b/po/he.po @@ -12251,6 +12251,13 @@ msgstr "REG QUERY key_name [/v value_name | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "Error: Invalid key name\n" +#: reg.rc:72 +#, fuzzy +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "" +"הקובץ כבר קיים.\n" +"האם ברצונך להחליף אותו?" + #: regedit.rc:34 msgid "&Registry" msgstr "&רישום המערכת" diff --git a/po/hi.po b/po/hi.po index 458c8690452..26253b25e87 100644 --- a/po/hi.po +++ b/po/hi.po @@ -11619,6 +11619,10 @@ msgstr "" msgid "reg: Invalid system key [%1]\n" msgstr "" +#: reg.rc:72 +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/hr.po b/po/hr.po index 9968fea57d5..ce3017c0b39 100644 --- a/po/hr.po +++ b/po/hr.po @@ -12011,6 +12011,12 @@ msgstr "REG QUERY ime_ključa [/v ime_vrijednosti | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "Greška: Neispravan naziv ključa\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The specified file already exists. Do you want to replace it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "Odabrana datoteka već postoji. Želite li je zamijeniti?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registar" diff --git a/po/hu.po b/po/hu.po index 530a24bd88e..b521dd90837 100644 --- a/po/hu.po +++ b/po/hu.po @@ -12495,6 +12495,12 @@ msgstr "REG QUERY kulcs_név [/v érték_név | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "Hiba: Érvénytelen kulcsnév\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The specified file already exists. Do you want to replace it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "A fájl már létezik. Lecseréli a fájlt?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Fájl" diff --git a/po/it.po b/po/it.po index 7f4d281ff2d..181a7214b82 100644 --- a/po/it.po +++ b/po/it.po @@ -12581,6 +12581,12 @@ msgstr "REG QUERY nome_della_chiave [/v nome_del_valore | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "Errore: nome della chiave non valido\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The specified file already exists. Do you want to replace it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "Il file specificato esiste già. Vuoi sostituirlo?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registro" diff --git a/po/ja.po b/po/ja.po index dc7537f97cf..9c709775342 100644 --- a/po/ja.po +++ b/po/ja.po @@ -12210,6 +12210,12 @@ msgstr "REG IMPORT ファイル.reg\n" msgid "reg: Invalid system key [%1]\n" msgstr "regedit: システム キーが無効です [%1]\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The registry value '%1' already exists. Do you want to overwrite it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "レジストリ値 '%1' はすでに存在します。上書きしますか?" + #: regedit.rc:34 msgid "&Registry" msgstr "レジストリ(&R)" diff --git a/po/ko.po b/po/ko.po index b5f55f1ab69..3ba88f9302c 100644 --- a/po/ko.po +++ b/po/ko.po @@ -12571,6 +12571,12 @@ msgstr "REG QUERY 키 이름 [/v 값| /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "오류: 올바르지 않은 키 이름\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The specified file already exists. Do you want to replace it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "지정된 파일은 이미 존재합니다.덮어 쓰시겠습니까?" + #: regedit.rc:34 msgid "&Registry" msgstr "레지스트리(&R)" diff --git a/po/lt.po b/po/lt.po index e034950d2ed..070a7d6a3c0 100644 --- a/po/lt.po +++ b/po/lt.po @@ -12197,6 +12197,12 @@ msgstr "REG IMPORT failas.reg\n" msgid "reg: Invalid system key [%1]\n" msgstr "regedit: Netinkamas sisteminis raktas [%1]\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The registry value '%1' already exists. Do you want to overwrite it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "Registro reikšmė „%1“ jau egzistuoja. Ar norite ją perrašyti?" + #: regedit.rc:34 msgid "&Registry" msgstr "R&egistras" diff --git a/po/ml.po b/po/ml.po index 8dc3278c2a2..17c40ef4f60 100644 --- a/po/ml.po +++ b/po/ml.po @@ -11619,6 +11619,10 @@ msgstr "" msgid "reg: Invalid system key [%1]\n" msgstr "" +#: reg.rc:72 +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/nb_NO.po b/po/nb_NO.po index 16a6e815b9b..9e9db11b206 100644 --- a/po/nb_NO.po +++ b/po/nb_NO.po @@ -12227,6 +12227,12 @@ msgstr "REG QUERY nøkkelnavn [/v verdi | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "regedit: Ugyldig systemnøkkel [%1]\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The registry value '%1' already exists. Do you want to overwrite it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "Registerverdien \"%1\" finnes fra før. Vil du erstatte den?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Register" diff --git a/po/nl.po b/po/nl.po index 5fa5b405741..746f2d1279d 100644 --- a/po/nl.po +++ b/po/nl.po @@ -12506,6 +12506,12 @@ msgstr "REG QUERY sleutel_naam [/v waarde_naam | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "Fout: Foutieve sleutelnaam\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The specified file already exists. Do you want to replace it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "Het gespecifeerde bestand bestaat reeds. Wilt u het vervangen?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registerbestand" diff --git a/po/or.po b/po/or.po index 1160af7cc22..ec883e05e88 100644 --- a/po/or.po +++ b/po/or.po @@ -11619,6 +11619,10 @@ msgstr "" msgid "reg: Invalid system key [%1]\n" msgstr "" +#: reg.rc:72 +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/pa.po b/po/pa.po index 7f7715f391c..5d90dacf4ed 100644 --- a/po/pa.po +++ b/po/pa.po @@ -11619,6 +11619,10 @@ msgstr "" msgid "reg: Invalid system key [%1]\n" msgstr "" +#: reg.rc:72 +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/pl.po b/po/pl.po index f3ab10f222e..0cd728eeff5 100644 --- a/po/pl.po +++ b/po/pl.po @@ -12275,6 +12275,12 @@ msgstr "REG QUERY nazwa_klucza [/v nazwa_wartości | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "regedit: Nieprawidłowy klucz systemowy [%1]\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The registry value '%1' already exists. Do you want to overwrite it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "Wartość rejestru '%1' już istnieje. Czy chesz ją zastąpić?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Rejestr" diff --git a/po/pt_BR.po b/po/pt_BR.po index 16e22de03f6..f8f9b3cc288 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -12371,6 +12371,12 @@ msgstr "REG QUERY nome_chave [/v nome_valor | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "reg: Nome de chave inválido\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The registry value '%1' already exists. Do you want to overwrite it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "O valor do registro '%1' já existe. Deseja sobrescrevê-lo?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registro" diff --git a/po/pt_PT.po b/po/pt_PT.po index 0a040e82115..d27de040dea 100644 --- a/po/pt_PT.po +++ b/po/pt_PT.po @@ -12372,6 +12372,12 @@ msgstr "REG QUERY nome_chave [/v nome_valor | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "Erro: Nome de chave inválido\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The specified file already exists. Do you want to replace it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "O ficheiro especificado já existe. Deseja substituí-lo?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registo" diff --git a/po/rm.po b/po/rm.po index 258653cc469..2644c232575 100644 --- a/po/rm.po +++ b/po/rm.po @@ -11704,6 +11704,10 @@ msgstr "" msgid "reg: Invalid system key [%1]\n" msgstr "" +#: reg.rc:72 +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/ro.po b/po/ro.po index efa3e062299..121254a2c17 100644 --- a/po/ro.po +++ b/po/ro.po @@ -12306,6 +12306,12 @@ msgstr "REG QUERY nume_cheie [/v nume_valoare | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "reg: Nume de cheie nevalid\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The registry value '%1' already exists. Do you want to overwrite it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "Valoare de registru „%1” există deja. Doriți să o înlocuiți?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registru" diff --git a/po/ru.po b/po/ru.po index 06eb69a38c2..408d70ec964 100644 --- a/po/ru.po +++ b/po/ru.po @@ -12195,6 +12195,12 @@ msgstr "REG IMPORT file.reg\n" msgid "reg: Invalid system key [%1]\n" msgstr "regedit: неверный системный ключ [%1]\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The registry value '%1' already exists. Do you want to overwrite it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "Значение «%1» уже существует. Вы хотите заменить его?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Реестр" diff --git a/po/sk.po b/po/sk.po index 0c2f9da3b07..059159558ea 100644 --- a/po/sk.po +++ b/po/sk.po @@ -11944,6 +11944,16 @@ msgstr "" msgid "reg: Invalid system key [%1]\n" msgstr "Nesprávny názov.\n" +#: reg.rc:72 +#, fuzzy +#| msgid "" +#| "File already exists.\n" +#| "Do you want to replace it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "" +"Súbor už existuje.\n" +"Prajete si ho prepísať?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registry" diff --git a/po/sl.po b/po/sl.po index d55b5c57ab1..5faecbba004 100644 --- a/po/sl.po +++ b/po/sl.po @@ -12524,6 +12524,12 @@ msgstr "REG QUERY ime_ključa [/v ime_vrednosti | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "Napaka: neveljavno ime ključa\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The specified file already exists. Do you want to replace it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "Določena datoteka že obstaja. Ali jo želite zamenjati?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Register" diff --git a/po/sr_RS@cyrillic.po b/po/sr_RS@cyrillic.po index cf19f5fccb5..6516ac21e92 100644 --- a/po/sr_RS@cyrillic.po +++ b/po/sr_RS@cyrillic.po @@ -12326,6 +12326,13 @@ msgstr "" msgid "reg: Invalid system key [%1]\n" msgstr "Неисправна синтакса.\n" +#: reg.rc:72 +#, fuzzy +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "" +"Датотека већ постоји.\n" +"Желите ли да је замените?" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/sr_RS@latin.po b/po/sr_RS@latin.po index f5b0c3fcdc8..3904753b349 100644 --- a/po/sr_RS@latin.po +++ b/po/sr_RS@latin.po @@ -12484,6 +12484,13 @@ msgstr "" msgid "reg: Invalid system key [%1]\n" msgstr "Neispravna sintaksa.\n" +#: reg.rc:72 +#, fuzzy +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "" +"Datoteka već postoji.\n" +"Želite li da je zamenite?" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/sv.po b/po/sv.po index dcc04bd6fa8..4503b969723 100644 --- a/po/sv.po +++ b/po/sv.po @@ -12196,6 +12196,12 @@ msgstr "REG QUERY nyckelnamn [/v värdenamn | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "reg: Ogiltigt nyckelnamn\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The registry value '%1' already exists. Do you want to overwrite it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "Värdet '%1' finns redan i registret. Vill du ersätta det?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Register" diff --git a/po/te.po b/po/te.po index fd34647ed55..ed8b2d8af8d 100644 --- a/po/te.po +++ b/po/te.po @@ -11619,6 +11619,10 @@ msgstr "" msgid "reg: Invalid system key [%1]\n" msgstr "" +#: reg.rc:72 +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/th.po b/po/th.po index 9a8f2c7646a..0ced886ccf8 100644 --- a/po/th.po +++ b/po/th.po @@ -11866,6 +11866,18 @@ msgstr "" msgid "reg: Invalid system key [%1]\n" msgstr "" +#: reg.rc:72 +#, fuzzy +#| msgid "" +#| "File '%s' does not exist.\n" +#| "\n" +#| "Do you want to create a new file?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "" +"ไม่พบแฟ้ม '%s' ที่ต้องการเปิด\n" +"\n" +"คุณต้องการสร้างใหม่ไม่?" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/tr.po b/po/tr.po index 6e5001b00d0..159a6224976 100644 --- a/po/tr.po +++ b/po/tr.po @@ -12252,6 +12252,12 @@ msgstr "REG QUERY anahtar_adı [/v değer_adı | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "reg: Geçersiz anahtar adı\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The registry value '%1' already exists. Do you want to overwrite it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "Belirtilen '%1' kayıt defteri değeri zaten var. Üzerine yazılsın mı?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Kayıt Defteri" diff --git a/po/uk.po b/po/uk.po index ce594d82a50..40c38f05dfb 100644 --- a/po/uk.po +++ b/po/uk.po @@ -12327,6 +12327,12 @@ msgstr "REG QUERY <ключ> [/v <параметр> | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "reg: невірне ім'я ключа\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The registry value '%1' already exists. Do you want to overwrite it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "Значення реєстру '%1' вже існує. Ви хочете його замінити?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Реєстр" diff --git a/po/wa.po b/po/wa.po index 1d11aadd2db..4ce8185cf4c 100644 --- a/po/wa.po +++ b/po/wa.po @@ -11770,6 +11770,10 @@ msgstr "" msgid "reg: Invalid system key [%1]\n" msgstr "" +#: reg.rc:72 +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/wine.pot b/po/wine.pot index 73c441ea9ff..d3765baa9c7 100644 --- a/po/wine.pot +++ b/po/wine.pot @@ -11546,6 +11546,10 @@ msgstr "" msgid "reg: Invalid system key [%1]\n" msgstr "" +#: reg.rc:72 +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/zh_CN.po b/po/zh_CN.po index e300be6e2a8..cd45163de32 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -12013,6 +12013,12 @@ msgstr "REG IMPORT file.reg\n" msgid "reg: Invalid system key [%1]\n" msgstr "regedit: 无效的键名 [%1]\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The registry value '%1' already exists. Do you want to overwrite it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "注册表值 '%1' 已经存在。您想要覆盖它吗?" + #: regedit.rc:34 msgid "&Registry" msgstr "注册表(&R)" diff --git a/po/zh_TW.po b/po/zh_TW.po index 2d7b0b5423b..1e6ac4ff1ed 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -12455,6 +12455,12 @@ msgstr "REG QUERY 索引鍵名稱 [/v 值名稱 | /ve] [/s]\n" msgid "reg: Invalid system key [%1]\n" msgstr "錯誤:無效的索引鍵名稱\n" +#: reg.rc:72 +#, fuzzy +#| msgid "The specified file already exists. Do you want to replace it?" +msgid "The file '%1' already exists. Do you want to overwrite it?" +msgstr "檔案已經存在。您要取代嗎?" + #: regedit.rc:34 msgid "&Registry" msgstr "註冊表(&R)" diff --git a/programs/reg/export.c b/programs/reg/export.c index 9d0d33274e7..81ffd220a37 100644 --- a/programs/reg/export.c +++ b/programs/reg/export.c @@ -17,6 +17,7 @@ */ #include +#include #include #include @@ -25,6 +26,44 @@ WINE_DEFAULT_DEBUG_CHANNEL(reg); +static HANDLE create_file(const WCHAR *filename, DWORD action) +{ + return CreateFileW(filename, GENERIC_WRITE, 0, NULL, action, FILE_ATTRIBUTE_NORMAL, NULL); +} + +static HANDLE get_file_handle(WCHAR *filename, BOOL overwrite_file) +{ + HANDLE hFile = create_file(filename, overwrite_file ? CREATE_ALWAYS : CREATE_NEW); + + if (hFile == INVALID_HANDLE_VALUE) + { + DWORD error = GetLastError(); + + if (error == ERROR_FILE_EXISTS) + { + if (!ask_confirm(STRING_OVERWRITE_FILE, filename)) + { + output_message(STRING_CANCELLED); + exit(0); + } + + hFile = create_file(filename, CREATE_ALWAYS); + } + else + { + WCHAR *str; + + FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, NULL, error, 0, (WCHAR *)&str, 0, NULL); + output_writeconsole(str, lstrlenW(str)); + LocalFree(str); + exit(1); + } + } + + return hFile; +} + static BOOL is_overwrite_switch(const WCHAR *s) { if (strlenW(s) > 2) @@ -40,6 +79,8 @@ int reg_export(int argc, WCHAR *argv[]) { HKEY root, hkey; WCHAR *path, *long_key; + BOOL overwrite_file = FALSE; + HANDLE hFile; if (argc == 3 || argc > 5) goto error; @@ -47,7 +88,7 @@ int reg_export(int argc, WCHAR *argv[]) if (!parse_registry_key(argv[2], &root, &path, &long_key)) return 1; - if (argc == 5 && !is_overwrite_switch(argv[4])) + if (argc == 5 && !(overwrite_file = is_overwrite_switch(argv[4]))) goto error; if (RegOpenKeyExW(root, path, 0, KEY_READ, &hkey)) @@ -56,7 +97,9 @@ int reg_export(int argc, WCHAR *argv[]) return 1; } + hFile = get_file_handle(argv[3], overwrite_file); FIXME(": operation not yet implemented\n"); + CloseHandle(hFile); RegCloseKey(hkey); diff --git a/programs/reg/reg.c b/programs/reg/reg.c index e26928470e8..a3e2cf730a5 100644 --- a/programs/reg/reg.c +++ b/programs/reg/reg.c @@ -111,7 +111,7 @@ BOOL heap_free(void *buf) return HeapFree(GetProcessHeap(), 0, buf); } -static void output_writeconsole(const WCHAR *str, DWORD wlen) +void output_writeconsole(const WCHAR *str, DWORD wlen) { DWORD count, ret; @@ -176,7 +176,7 @@ static void WINAPIV output_string(const WCHAR *fmt, ...) } /* ask_confirm() adapted from programs/cmd/builtins.c */ -static BOOL ask_confirm(unsigned int msgid, WCHAR *reg_info) +BOOL ask_confirm(unsigned int msgid, WCHAR *reg_info) { HMODULE hmod; WCHAR Ybuffer[4]; diff --git a/programs/reg/reg.h b/programs/reg/reg.h index 3b5ab86ff99..35f22a5db60 100644 --- a/programs/reg/reg.h +++ b/programs/reg/reg.h @@ -27,7 +27,9 @@ void *heap_xalloc(size_t size); void *heap_xrealloc(void *buf, size_t size); BOOL heap_free(void *buf); +void output_writeconsole(const WCHAR *str, DWORD wlen); void WINAPIV output_message(unsigned int id, ...); +BOOL ask_confirm(unsigned int msgid, WCHAR *reg_info); HKEY path_get_rootkey(const WCHAR *path); BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path, WCHAR **long_key); diff --git a/programs/reg/reg.rc b/programs/reg/reg.rc index 2ac0b228091..9d8cb882c7a 100644 --- a/programs/reg/reg.rc +++ b/programs/reg/reg.rc @@ -68,4 +68,5 @@ STRINGTABLE STRING_ESCAPE_SEQUENCE, "reg: Unrecognized escape sequence [\\%1!c!]\n" STRING_EXPORT_USAGE, "REG EXPORT key_name file.reg [/y]\n" STRING_INVALID_SYSTEM_KEY, "reg: Invalid system key [%1]\n" + STRING_OVERWRITE_FILE, "The file '%1' already exists. Do you want to overwrite it?" } diff --git a/programs/reg/resource.h b/programs/reg/resource.h index aef2ca97385..518f92ceac3 100644 --- a/programs/reg/resource.h +++ b/programs/reg/resource.h @@ -58,3 +58,4 @@ #define STRING_ESCAPE_SEQUENCE 135 #define STRING_EXPORT_USAGE 136 #define STRING_INVALID_SYSTEM_KEY 137 +#define STRING_OVERWRITE_FILE 138 diff --git a/programs/reg/tests/reg.c b/programs/reg/tests/reg.c index 9e4a8145a60..62299aa2686 100644 --- a/programs/reg/tests/reg.c +++ b/programs/reg/tests/reg.c @@ -4289,7 +4289,7 @@ static BOOL compare_export_(unsigned line, const char *filename, const char *exp lok(!lstrcmpW(fbuf, wstr), "export data does not match expected data\n"); ret = DeleteFileA(filename); - todo_wine lok(ret, "DeleteFile failed: %u\n", GetLastError()); + lok(ret, "DeleteFile failed: %u\n", GetLastError()); exit: HeapFree(GetProcessHeap(), 0, fbuf); @@ -4442,7 +4442,7 @@ static void test_export(void) else /* Windows XP (32-bit) and older */ win_skip("File overwrite flag [/y] not supported; skipping position tests\n"); - todo_wine ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n"); + ok(compare_export("file.reg", empty_key_test, TODO_REG_COMPARE), "compare_export() failed\n"); /* Test registry export with a simple data structure */ dword = 0x100; @@ -4451,7 +4451,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg", &r); todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", simple_test, 0), "compare_export() failed\n"); + ok(compare_export("file.reg", simple_test, TODO_REG_COMPARE), "compare_export() failed\n"); /* Test registry export with a complex data structure */ add_key(hkey, "Subkey1", &subkey); @@ -4489,7 +4489,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg", &r); todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", complex_test, 0), "compare_export() failed\n"); + ok(compare_export("file.reg", complex_test, TODO_REG_COMPARE), "compare_export() failed\n"); err = delete_tree(HKEY_CURRENT_USER, KEY_BASE); ok(err == ERROR_SUCCESS, "delete_tree() failed: %d\n", err); @@ -4503,7 +4503,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg", &r); todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", key_order_test, 0), "compare_export() failed\n"); + ok(compare_export("file.reg", key_order_test, TODO_REG_COMPARE), "compare_export() failed\n"); delete_key(hkey, "Subkey1"); delete_key(hkey, "Subkey2"); @@ -4518,7 +4518,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg", &r); todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", value_order_test, 0), "compare_export() failed\n"); + ok(compare_export("file.reg", value_order_test, TODO_REG_COMPARE), "compare_export() failed\n"); delete_key(HKEY_CURRENT_USER, KEY_BASE); @@ -4536,7 +4536,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg", &r); todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", empty_hex_test, 0), "compare_export() failed\n"); + ok(compare_export("file.reg", empty_hex_test, TODO_REG_COMPARE), "compare_export() failed\n"); delete_key(HKEY_CURRENT_USER, KEY_BASE); @@ -4554,7 +4554,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg", &r); todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", empty_hex_test2, 0), "compare_export() failed\n"); + ok(compare_export("file.reg", empty_hex_test2, TODO_REG_COMPARE), "compare_export() failed\n"); delete_key(HKEY_CURRENT_USER, KEY_BASE); @@ -4573,7 +4573,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg", &r); todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", hex_types_test, 0), "compare_export() failed\n"); + ok(compare_export("file.reg", hex_types_test, TODO_REG_COMPARE), "compare_export() failed\n"); delete_key(HKEY_CURRENT_USER, KEY_BASE); }