• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test --newline option.
5
6if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
7  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
8  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
9    ac_n= ac_c='
10' ac_t='        '
11  else
12    ac_n=-n ac_c= ac_t=
13  fi
14else
15  ac_n= ac_c='\c' ac_t=
16fi
17
18cat <<\EOF > mfi-test8.po
19# HEADER.
20#
21msgid ""
22msgstr ""
23"Project-Id-Version: Bonnie Tyler\n"
24"Content-Type: text/plain; charset=ISO-8859-1\n"
25"Content-Transfer-Encoding: 8bit\n"
26
27#: married-men:4
28#, fuzzy
29msgid "The world is full of married men"
30msgstr "So viele verheiratete M�nner"
31
32#: married-men:5
33msgid "with wives who never understand"
34msgstr "und ihre Frauen verstehen sie nicht"
35
36#: married-men:6
37msgid "They're looking for someone to share"
38msgstr ""
39
40# schwer zu �bersetzen...
41#: married-men:7
42msgid "the excitement of a love affair"
43msgstr ""
44
45#: married-men:8
46msgid "Just as soon as they find you"
47msgstr ""
48
49#: married-men:9
50msgid "They warn you and darn you"
51msgstr ""
52
53#~ msgid "You fly on the wings of romance"
54#~ msgstr "Die Fl�gel der frischen Liebe heben dich zum Himmel"
55
56#, fuzzy
57#~ msgid "In the eyes of the world"
58#~ msgstr "F�r die anderen"
59
60# Etwas freie �bersetzung.
61#~ msgid "You're just another crazy girl"
62#~ msgstr "bist du blo� ein verr�cktes dummes Ding"
63
64#~ msgid "Who loves a married man"
65#~ msgstr "das einen verheirateten Mann liebt"
66EOF
67
68cat <<\EOF > filter.sh
69#!/bin/sh
70cat
71if test "$MSGFILTER_MSGID" = "the excitement of a love affair"; then
72  echo $ac_n "non-terminated line$ac_c"
73else
74  echo terminated line
75fi
76EOF
77
78: ${MSGFILTER=msgfilter}
79case "$host_os" in
80  mingw*) CONFIG_SHELL='sh' ;;
81  *) : ${CONFIG_SHELL=${SHELL-/bin/sh}} ;;
82esac
83LC_ALL=C ${MSGFILTER} --newline -i mfi-test8.po -o mfi-test8.out \
84      ${CONFIG_SHELL} filter.sh >mfi-test8.err 2>&1
85result=$?
86cat mfi-test8.err | grep -v 'warning: Locale charset' | grep -v '^ '
87test $result = 0 || { Exit 1; }
88cat mfi-test8.err | grep 'msgfilter: filter output is not terminated with a newline' >/dev/null
89test $result = 0 || { Exit 1; }
90
91cat <<\EOF > mfi-test8.ok
92# HEADER.
93#
94msgid ""
95msgstr ""
96"Project-Id-Version: Bonnie Tyler\n"
97"Content-Type: text/plain; charset=ISO-8859-1\n"
98"Content-Transfer-Encoding: 8bit\n"
99"\n"
100"terminated line"
101
102#: married-men:4
103#, fuzzy
104msgid "The world is full of married men"
105msgstr ""
106"So viele verheiratete M�nner\n"
107"terminated line"
108
109#: married-men:5
110msgid "with wives who never understand"
111msgstr ""
112"und ihre Frauen verstehen sie nicht\n"
113"terminated line"
114
115#: married-men:6
116msgid "They're looking for someone to share"
117msgstr ""
118"\n"
119"terminated line"
120
121# schwer zu �bersetzen...
122#: married-men:7
123msgid "the excitement of a love affair"
124msgstr ""
125"\n"
126"non-terminated line"
127
128#: married-men:8
129msgid "Just as soon as they find you"
130msgstr ""
131"\n"
132"terminated line"
133
134#: married-men:9
135msgid "They warn you and darn you"
136msgstr ""
137"\n"
138"terminated line"
139
140#~ msgid "You fly on the wings of romance"
141#~ msgstr ""
142#~ "Die Fl�gel der frischen Liebe heben dich zum Himmel\n"
143#~ "terminated line"
144
145#, fuzzy
146#~ msgid "In the eyes of the world"
147#~ msgstr ""
148#~ "F�r die anderen\n"
149#~ "terminated line"
150
151# Etwas freie �bersetzung.
152#~ msgid "You're just another crazy girl"
153#~ msgstr ""
154#~ "bist du blo� ein verr�cktes dummes Ding\n"
155#~ "terminated line"
156
157#~ msgid "Who loves a married man"
158#~ msgstr ""
159#~ "das einen verheirateten Mann liebt\n"
160#~ "terminated line"
161EOF
162
163: ${DIFF=diff}
164${DIFF} mfi-test8.ok mfi-test8.out
165result=$?
166
167exit $result
168