Merge branch 'maint'

* maint:
  test-lib: fix broken printf
  git apply --directory broken for new files
This commit is contained in:
Shawn O. Pearce
2008-10-12 13:21:17 -07:00
3 changed files with 60 additions and 1 deletions

View File

@ -805,6 +805,13 @@ static int parse_git_header(char *line, int len, unsigned int size, struct patch
* the default name from the header.
*/
patch->def_name = git_header_name(line, len);
if (patch->def_name && root) {
char *s = xmalloc(root_len + strlen(patch->def_name) + 1);
strcpy(s, root);
strcpy(s + root_len, patch->def_name);
free(patch->def_name);
patch->def_name = s;
}
line += len;
size -= len;