| 1373 | } |
| 1374 | |
| 1375 | static int prompt_yesno(struct add_p_state *s, const char *prompt) |
| 1376 | { |
| 1377 | for (;;) { |
| 1378 | color_fprintf(stdout, s->cfg.prompt_color, "%s", _(prompt)); |
| 1379 | fflush(stdout); |
| 1380 | if (read_single_character(s) == EOF) |
| 1381 | return -1; |
| 1382 | /* do not limit to 1-byte input to allow 'no' etc. */ |
| 1383 | switch (tolower(s->answer.buf[0])) { |
| 1384 | case 'n': return 0; |
| 1385 | case 'y': return 1; |
| 1386 | } |
| 1387 | } |
| 1388 | } |
| 1389 | |
| 1390 | static int edit_hunk_loop(struct add_p_state *s, |
| 1391 | struct file_diff *file_diff, struct hunk *hunk) |
no test coverage detected