]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
msginit: Don't backup when mergeing a PO file and --no-translator is given.
authorBruno Haible <bruno@clisp.org>
Wed, 28 Jan 2026 23:06:13 +0000 (00:06 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 28 Jan 2026 23:36:19 +0000 (00:36 +0100)
* gettext-tools/src/msginit.c (main): Don't create a backup file if
--no-translator is specified.

gettext-tools/src/msginit.c

index 16a1729b38a3e1edbb80ddd5538d37eceb070e73..228d1d024d2fd55109f08531851c58926c82dbe5 100644 (file)
@@ -318,15 +318,18 @@ This is necessary so you can test your translations.\n"),
          continue, based on these translations.  */
 
       /* First, create a backup file.  */
-      {
-        const char *backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX");
-        if (backup_suffix_string != NULL && backup_suffix_string[0] != '\0')
-          simple_backup_suffix = backup_suffix_string;
-      }
-      {
-        char *backup_file = find_backup_file_name (output_file, simple);
-        xcopy_file_preserving (output_file, backup_file);
-      }
+      if (!no_translator)
+        {
+          {
+            const char *backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX");
+            if (backup_suffix_string != NULL && backup_suffix_string[0] != '\0')
+              simple_backup_suffix = backup_suffix_string;
+          }
+          {
+            char *backup_file = find_backup_file_name (output_file, simple);
+            xcopy_file_preserving (output_file, backup_file);
+          }
+        }
 
       /* Initialize OpenMP.  */
       #ifdef _OPENMP