invoked. */
parse_comment_filepos (catr, s + 1);
}
- else if (*s == ',' || *s == '!')
+ else if (*s == ',' || *s == '=' || *s == '!')
{
/* Get all entries in the special comment line. */
catalog_reader_seen_comment_special (catr, s + 1);
-/* Parsing of special comments (#, comments) in textual message catalogs.
+/* Parsing of special comments (#, and #= comments) in textual message catalogs.
Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
-/* Parsing of special comments (#, comments) in textual message catalogs.
+/* Parsing of special comments (#, and #= comments) in textual message catalogs.
Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
}
-/* Test for '#, fuzzy' comments and warn. */
+/* Test for '#, fuzzy' or '#= fuzzy' comments and warn. */
void
default_comment_special (abstract_catalog_reader_ty *catr, const char *s)
{
default_catalog_reader_ty *dcatr = (default_catalog_reader_ty *) catr;
+ bool tmp_fuzzy;
+ enum is_format tmp_format[NFORMATS];
+ struct argument_range tmp_range;
+ enum is_wrap tmp_wrap;
+ size_t i;
+
+ parse_comment_special (s, &tmp_fuzzy, tmp_format, &tmp_range, &tmp_wrap,
+ NULL);
- parse_comment_special (s, &dcatr->is_fuzzy, dcatr->is_format, &dcatr->range,
- &dcatr->do_wrap, NULL);
+ if (tmp_fuzzy)
+ dcatr->is_fuzzy = true;
+ for (i = 0; i < NFORMATS; i++)
+ if (tmp_format[i] != undecided)
+ dcatr->is_format[i] = tmp_format[i];
+ if (has_range_p (tmp_range))
+ {
+ if (has_range_p (dcatr->range))
+ {
+ if (tmp_range.min < dcatr->range.min)
+ dcatr->range.min = tmp_range.min;
+ if (tmp_range.max > dcatr->range.max)
+ dcatr->range.max = tmp_range.max;
+ }
+ else
+ dcatr->range = tmp_range;
+ }
+ if (tmp_wrap != undecided)
+ dcatr->do_wrap = tmp_wrap;
}
msgcat-1 msgcat-2 msgcat-3 msgcat-4 msgcat-5 msgcat-6 msgcat-7 \
msgcat-8 msgcat-9 msgcat-10 msgcat-11 msgcat-12 msgcat-13 msgcat-14 \
msgcat-15 msgcat-16 msgcat-17 msgcat-18 msgcat-19 msgcat-20 msgcat-21 \
- msgcat-22 msgcat-23 \
+ msgcat-22 msgcat-23 msgcat-24 \
msgcat-properties-1 msgcat-properties-2 \
msgcat-stringtable-1 \
msgcmp-1 msgcmp-2 msgcmp-3 msgcmp-4 \
--- /dev/null
+#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
+
+# Test processing of PO files with '#=' flags lines.
+
+cat <<\EOF > mcat-test24.in1
+#, fuzzy
+#= c-format, no-wrap
+msgid "%d marbles in box 1"
+msgstr "%d Murmeln in der Schachtel 1"
+
+#, fuzzy, c-format
+#= no-wrap
+msgid "%d marbles in box 2"
+msgstr "%d Murmeln in der Schachtel 2"
+
+#, fuzzy, no-wrap
+#= c-format
+msgid "%d marbles in box 3"
+msgstr "%d Murmeln in der Schachtel 3"
+
+#, c-format, no-wrap
+#= fuzzy
+msgid "%d marbles in box 4"
+msgstr "%d Murmeln in der Schachtel 4"
+
+#, no-wrap
+#= fuzzy, c-format
+msgid "%d marbles in box 5"
+msgstr "%d Murmeln in der Schachtel 5"
+
+#, c-format
+#= fuzzy, no-wrap
+msgid "%d marbles in box 6"
+msgstr "%d Murmeln in der Schachtel 6"
+EOF
+
+rm -f mcat-test24.tmp
+: ${MSGCAT=msgcat}
+${MSGCAT} -o mcat-test24.tmp mcat-test24.in1 || Exit 1
+LC_ALL=C tr -d '\r' < mcat-test24.tmp > mcat-test24.out || Exit 1
+
+cat << EOF > mcat-test24.ok
+#, fuzzy, c-format, no-wrap
+msgid "%d marbles in box 1"
+msgstr "%d Murmeln in der Schachtel 1"
+
+#, fuzzy, c-format, no-wrap
+msgid "%d marbles in box 2"
+msgstr "%d Murmeln in der Schachtel 2"
+
+#, fuzzy, c-format, no-wrap
+msgid "%d marbles in box 3"
+msgstr "%d Murmeln in der Schachtel 3"
+
+#, fuzzy, c-format, no-wrap
+msgid "%d marbles in box 4"
+msgstr "%d Murmeln in der Schachtel 4"
+
+#, fuzzy, c-format, no-wrap
+msgid "%d marbles in box 5"
+msgstr "%d Murmeln in der Schachtel 5"
+
+#, fuzzy, c-format, no-wrap
+msgid "%d marbles in box 6"
+msgstr "%d Murmeln in der Schachtel 6"
+EOF
+
+: ${DIFF=diff}
+${DIFF} mcat-test24.ok mcat-test24.out
+result=$?
+
+exit $result