From: Bruno Haible Date: Mon, 13 Nov 2006 12:44:39 +0000 (+0000) Subject: Indent with spaces, not tabs. X-Git-Tag: v0.17~648 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a77f7398e9d9d389db4ad2d6ead34d8317f4222;p=thirdparty%2Fgettext.git Indent with spaces, not tabs. --- diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 18ff3120d..1eb6e2281 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,7 @@ +2006-11-12 Bruno Haible + + * write-po.c (wrap): Indent by use of spaces, not tabs. + 2006-11-03 Bruno Haible Simplify xmalloc expressions. Add overflow check in xmalloc arguments. diff --git a/gettext-tools/src/write-po.c b/gettext-tools/src/write-po.c index 4db0972a3..2afce96cb 100644 --- a/gettext-tools/src/write-po.c +++ b/gettext-tools/src/write-po.c @@ -725,30 +725,45 @@ internationalized messages should not contain the `\\%c' escape sequence"), /* Print the beginning of the line. This will depend on whether this is the first line, and if the indented style is being used. INDENT-F. */ - if (line_prefix != NULL) - fputs (line_prefix, fp); - if (first_line) - { - fputs (name, fp); - if (indent) - { - if (extra_indent > 0) - fwrite (" ", 1, extra_indent, fp); - putc ('\t', fp); - } - else - putc (' ', fp); - first_line = false; - } - else - { - if (indent) - { - if (extra_indent > 0) - fwrite (" ", 1, extra_indent, fp); - putc ('\t', fp); - } - } + { + int currcol = 0; + + if (line_prefix != NULL) + { + fputs (line_prefix, fp); + currcol = strlen (line_prefix); + } + if (first_line) + { + fputs (name, fp); + currcol += strlen (name); + if (indent) + { + if (extra_indent > 0) + fwrite (" ", 1, extra_indent, fp); + currcol += extra_indent; + fwrite (" ", 1, 8 - (currcol & 7), fp); + currcol = (currcol + 8) & ~7; + } + else + { + putc (' ', fp); + currcol++; + } + first_line = false; + } + else + { + if (indent) + { + if (extra_indent > 0) + fwrite (" ", 1, extra_indent, fp); + currcol += extra_indent; + fwrite (" ", 1, 8 - (currcol & 7), fp); + currcol = (currcol + 8) & ~7; + } + } + } /* Print the portion itself, with linebreaks where necessary. */ putc ('"', fp); @@ -756,12 +771,21 @@ internationalized messages should not contain the `\\%c' escape sequence"), { if (linebreaks[i] == UC_BREAK_POSSIBLE) { + int currcol; + fputs ("\"\n", fp); + currcol = 0; /* INDENT-S. */ if (line_prefix != NULL) - fputs (line_prefix, fp); + { + fputs (line_prefix, fp); + currcol = strlen (line_prefix); + } if (indent) - putc ('\t', fp); + { + fwrite (" ", 1, 8 - (currcol & 7), fp); + currcol = (currcol + 8) & ~7; + } putc ('"', fp); } putc (portion[i], fp); diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog index bf3551938..d258a8790 100644 --- a/gettext-tools/tests/ChangeLog +++ b/gettext-tools/tests/ChangeLog @@ -1,3 +1,7 @@ +2006-11-12 Bruno Haible + + * msgcat-15: Update expected test output. + 2006-11-03 Bruno Haible Simplify xmalloc expressions. Add overflow check in xmalloc arguments. diff --git a/gettext-tools/tests/msgcat-15 b/gettext-tools/tests/msgcat-15 index 5d655b75e..7dd3f7b71 100755 --- a/gettext-tools/tests/msgcat-15 +++ b/gettext-tools/tests/msgcat-15 @@ -62,40 +62,40 @@ test $? = 0 || { rm -fr $tmpfiles; exit 1; } tmpfiles="$tmpfiles mcat-test15.ok" cat <<\EOF > mcat-test15.ok -msgid "" -msgstr "Report-Msgid-Bugs-To: \n" - "Content-Type: text/plain; charset=UTF-8\n" - "Content-Transfer-Encoding: 8bit\n" +msgid "" +msgstr "Report-Msgid-Bugs-To: \n" + "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" #. TRANSLATORS: An error message. #: src/args.c:242 #, fuzzy, c-format -#| msgid "too many arguments" -msgid "Too many arguments." -msgstr "zu viele Argumente" +#| msgid "too many arguments" +msgid "Too many arguments." +msgstr "zu viele Argumente" #. TRANSLATORS: An error message. #: src/args.c:247 #, fuzzy, c-format -#| msgid "too many arguments" -msgid "Too few arguments." -msgstr "zu viele Argumente" +#| msgid "too many arguments" +msgid "Too few arguments." +msgstr "zu viele Argumente" # Oder besser "fehlende Argumente"? #. TRANSLATORS: An error message. #: src/args.c:273 #, c-format -#| msgid "missing arguments" -msgid "Missing arguments." -msgstr "Argumente fehlen." +#| msgid "missing arguments" +msgid "Missing arguments." +msgstr "Argumente fehlen." #, fuzzy -#~| msgid "%s: invalid option -- %c\n" -#~ msgid "%s: illegal option -- %c\n" -#~ msgstr "%s: ungültige Option -- %c\n" +#~| msgid "%s: invalid option -- %c\n" +#~ msgid "%s: illegal option -- %c\n" +#~ msgstr "%s: ungültige Option -- %c\n" -#~ msgid "%s: invalid option -- %c\n" -#~ msgstr "%s: ungültige Option -- %c\n" +#~ msgid "%s: invalid option -- %c\n" +#~ msgstr "%s: ungültige Option -- %c\n" EOF : ${DIFF=diff}