Fix regression when running tig with no arguments and custom encoding
commit2d61ff12a8e04d4e5b0902c233f53fb27c0420fc
authorDrew Northup <n1xim.email@gmail.com>
Wed, 24 Jul 2013 12:50:27 +0000 (24 08:50 -0400)
committerJonas Fonseca <fonseca@diku.dk>
Mon, 29 Jul 2013 01:14:37 +0000 (28 21:14 -0400)
tree2b0afb27faee2fa6278d641cdfc454d44f1c85b2
parent550e32836b5190ad0d206dbe6ae42150f0136cbd
Fix regression when running tig with no arguments and custom encoding

Since c7d67ab running "tig" with no options has failed with the error
"tig: No revisions match the given arguments." This was due to a change
in how the arguments for the back-end git call was being constructed.
This change caused the blank field left in place of "%(encoding_arg)"
when it is empty to not overwrite "buf" which then caused the value in
"buf" to be copied into dst_argv twice. The resulting git command failed
if there was no available revision named "log" as shown in the trace.

From the TIG_TRACE log:
git log log --no-color --pretty=raw --parents --parents --
fatal: bad revision 'log'

This fix works by properly and fully initializing "buf" before each use.

Fixes #167

Signed-off-by: Drew Northup <n1xim.email@gmail.com>
Minor edits of commit message and change patch to use sizeof(buf).

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
tig.c