Skip to content

Commit ba2b502

Browse files
committed
xgettext: fix error when using -o /absolute/path
if the outputfile is given, but no outputdir specified, we shall not prefix the outputfilename with `./`. experienced during the build of weechat 1.6.
1 parent d99bf44 commit ba2b502

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/xgettext.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
outputfile=
4-
outputdir=.
4+
outputdir=
55
domain=messages
66

77
spliteq() {
@@ -103,10 +103,14 @@ while true ; do
103103
shift
104104
done
105105

106-
[ -z "$outputfile" ] && outputfile=${domain}.po
107106
[ "$outputfile" = "-" ] && exit 0
108-
if [ ! -z "$outputfile" ] ; then
107+
if [ -z "$outputfile" ] ; then
108+
outputfile=${domain}.po
109+
[ -z "$outputdir" ] && outputdir=.
109110
touch $outputdir/$outputfile
111+
else
112+
[ -z "$outputdir" ] && touch $outputdir/$outputfile || \
113+
touch $outputfile
110114
fi
111115

112116

0 commit comments

Comments
 (0)