Python: Fix bug in python-brace-format.

* gettext-tools/src/format-python-brace.c (parse_directive): The name ends
before ':', not before '}'.
This commit is contained in:
Bruno Haible 2025-06-24 11:15:46 +02:00
parent 78e9a5d2d9
commit 340f82cfab

View 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);