fmt must contain _one_ %s and no other substitution */
| 368 | |
| 369 | /* fmt must contain _one_ %s and no other substitution */ |
| 370 | static void say_patch_name(FILE *output, const char *fmt, struct patch *patch) |
| 371 | { |
| 372 | struct strbuf sb = STRBUF_INIT; |
| 373 | |
| 374 | if (patch->old_name && patch->new_name && |
| 375 | strcmp(patch->old_name, patch->new_name)) { |
| 376 | quote_c_style(patch->old_name, &sb, NULL, 0); |
| 377 | strbuf_addstr(&sb, " => "); |
| 378 | quote_c_style(patch->new_name, &sb, NULL, 0); |
| 379 | } else { |
| 380 | const char *n = patch->new_name; |
| 381 | if (!n) |
| 382 | n = patch->old_name; |
| 383 | quote_c_style(n, &sb, NULL, 0); |
| 384 | } |
| 385 | fprintf(output, fmt, sb.buf); |
| 386 | fputc('\n', output); |
| 387 | strbuf_release(&sb); |
| 388 | } |
| 389 | |
| 390 | #define SLOP (16) |
| 391 |
no test coverage detected