check-attr: Add --stdin option
[gitweb.git] / builtin-apply.c
index f1f675819f22ec1b47fb7b25ed050dc4ddcad378..cfd8fceb9033cf5c4c7924d96437b94a9c4fe226 100644 (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;