Diagnostics placement honors the documented contract ($TMPDIR, /tmp * fallback) without touching cbm_tmpdir(), whose many other callers keep * their established behavior. Windows already resolves the real user temp. */
| 247 | * fallback) without touching cbm_tmpdir(), whose many other callers keep |
| 248 | * their established behavior. Windows already resolves the real user temp. */ |
| 249 | static const char *diag_tmp_base(char *buffer, size_t size) { |
| 250 | #ifdef _WIN32 |
| 251 | (void)buffer; |
| 252 | (void)size; |
| 253 | return cbm_tmpdir(); |
| 254 | #else |
| 255 | cbm_safe_getenv("TMPDIR", buffer, size, NULL); |
| 256 | if (buffer[0] != '\0') { |
| 257 | return buffer; |
| 258 | } |
| 259 | return "/tmp"; |
| 260 | #endif |
| 261 | } |
| 262 | |
| 263 | static bool diag_directory_prepare(void) { |
| 264 | char tmp_base[CBM_PATH_MAX]; |
no test coverage detected