]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Python: Fix bug in python-brace-format.
authorBruno Haible <bruno@clisp.org>
Tue, 24 Jun 2025 09:15:46 +0000 (11:15 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 24 Jun 2025 09:34:38 +0000 (11:34 +0200)
* gettext-tools/src/format-python-brace.c (parse_directive): The name ends
before ':', not before '}'.

gettext-tools/src/format-python-brace.c

index d6651961692a34951cbc34e7b8f0f3a2dd71b740..51086133b11a706d0ab21fcb1f4f921d1465928d 100644 (file)
@@ -142,6 +142,7 @@ parse_directive (struct spec *spec,
   const char *format = *formatp;
   const char *const format_start = format;
   const char *name_start;
+  const char *name_end;
   char c;
 
   c = *++format;
@@ -245,6 +246,8 @@ parse_directive (struct spec *spec,
         break;
     }
 
+  name_end = format;
+
   /* Here c == *format.  */
   if (c == ':')
     {
@@ -352,7 +355,7 @@ parse_directive (struct spec *spec,
   if (is_toplevel)
     {
       char *name;
-      size_t n = format - name_start;
+      size_t n = name_end - name_start;
 
       FDI_SET (name_start - 1, FMTDIR_START);