| 457 | } |
| 458 | |
| 459 | static void gf_command_diagnostic(cbm_git_facts_error_t *error, const gf_result_t *result) { |
| 460 | error->exit_code = result->exit_code; |
| 461 | size_t at = strlen(error->diagnostic); |
| 462 | if (result->err.length && at + 2 < sizeof(error->diagnostic)) { |
| 463 | error->diagnostic[at++] = ':'; |
| 464 | error->diagnostic[at++] = ' '; |
| 465 | } |
| 466 | for (size_t i = 0; i < result->err.length && at + 1 < sizeof(error->diagnostic); i++) { |
| 467 | unsigned char c = result->err.data[i]; |
| 468 | error->diagnostic[at++] = c >= 32 && c < 127 ? (char)c : ' '; |
| 469 | } |
| 470 | error->diagnostic[at] = '\0'; |
| 471 | } |
| 472 | |
| 473 | /* Observed file-size limits request cancellation. They are not instantaneous |
| 474 | * disk quotas; final retained bytes are bounded independently after quiescence. */ |