Retrieve, sanitize and cache operating system info for subsequent calls. Return a pointer to the sanitized operating system info string. */
| 44 | string. |
| 45 | */ |
| 46 | static const char *os_info(void) |
| 47 | { |
| 48 | static const char *os = NULL; |
| 49 | |
| 50 | if (!os) { |
| 51 | struct strbuf buf = STRBUF_INIT; |
| 52 | |
| 53 | get_uname_info(&buf, 0); |
| 54 | /* Sanitize the os information immediately */ |
| 55 | redact_non_printables(&buf); |
| 56 | os = strbuf_detach(&buf, NULL); |
| 57 | } |
| 58 | |
| 59 | return os; |
| 60 | } |
| 61 | |
| 62 | const char *git_user_agent_sanitized(void) |
| 63 | { |
no test coverage detected