Merge branch 'jk/prefix-filename'

Code clean-up with minor bugfixes.

* jk/prefix-filename:
  bundle: use prefix_filename with bundle path
  prefix_filename: simplify windows #ifdef
  prefix_filename: return newly allocated string
  prefix_filename: drop length parameter
  prefix_filename: move docstring to header file
  hash-object: fix buffer reuse with --path in a subdirectory
This commit is contained in:
Junio C Hamano
2017-03-27 10:59:26 -07:00
17 changed files with 86 additions and 75 deletions

View File

@ -228,9 +228,9 @@ static int show_file(const char *arg, int output_prefix)
if ((filter & (DO_NONFLAGS|DO_NOREV)) == (DO_NONFLAGS|DO_NOREV)) {
if (output_prefix) {
const char *prefix = startup_info->prefix;
show(prefix_filename(prefix,
prefix ? strlen(prefix) : 0,
arg));
char *fname = prefix_filename(prefix, arg);
show(fname);
free(fname);
} else
show(arg);
return 1;