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>