summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrofl0r <retnyg@gmx.net>2016-10-02 19:59:23 +0100
committerrofl0r <retnyg@gmx.net>2016-10-02 20:03:09 +0100
commitba2b502a2987fd23861329a852b43eb5e97fcbe2 (patch)
treea7000e1a8ef9e19ffb8dca275318a8eded88f0ef
parentd99bf44a8025a1b27dfae8b6a245883ba7f0bf4d (diff)
downloadgettext-tiny-ba2b502a2987fd23861329a852b43eb5e97fcbe2.tar.gz
xgettext: fix error when using -o /absolute/pathv0.0.5
if the outputfile is given, but no outputdir specified, we shall not prefix the outputfilename with `./`. experienced during the build of weechat 1.6.
-rwxr-xr-xsrc/xgettext.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/xgettext.sh b/src/xgettext.sh
index 3217355..42769a5 100755
--- a/src/xgettext.sh
+++ b/src/xgettext.sh
@@ -1,7 +1,7 @@
#!/bin/sh
outputfile=
-outputdir=.
+outputdir=
domain=messages
spliteq() {
@@ -103,10 +103,14 @@ while true ; do
shift
done
-[ -z "$outputfile" ] && outputfile=${domain}.po
[ "$outputfile" = "-" ] && exit 0
-if [ ! -z "$outputfile" ] ; then
+if [ -z "$outputfile" ] ; then
+ outputfile=${domain}.po
+ [ -z "$outputdir" ] && outputdir=.
touch $outputdir/$outputfile
+else
+ [ -z "$outputdir" ] && touch $outputdir/$outputfile || \
+ touch $outputfile
fi