From: Bruno Haible Date: Tue, 24 Jun 2025 09:15:46 +0000 (+0200) Subject: Python: Fix bug in python-brace-format. X-Git-Tag: v0.26~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=340f82cfabf72c01d1a8fdd63a5dcad45650aff6;p=thirdparty%2Fgettext.git Python: Fix bug in python-brace-format. * gettext-tools/src/format-python-brace.c (parse_directive): The name ends before ':', not before '}'. --- diff --git a/gettext-tools/src/format-python-brace.c b/gettext-tools/src/format-python-brace.c index d66519616..51086133b 100644 --- a/gettext-tools/src/format-python-brace.c +++ b/gettext-tools/src/format-python-brace.c @@ -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);