| 492 | } |
| 493 | |
| 494 | const char *cbm_app_local_dir(void) { |
| 495 | #ifdef _WIN32 |
| 496 | static CBM_TLS char buf[CBM_SZ_1K]; |
| 497 | char tmp[CBM_SZ_256] = ""; |
| 498 | cbm_safe_getenv("LOCALAPPDATA", tmp, sizeof(tmp), NULL); |
| 499 | if (tmp[0]) { |
| 500 | snprintf(buf, sizeof(buf), "%s", tmp); |
| 501 | cbm_normalize_path_sep(buf); |
| 502 | return buf; |
| 503 | } |
| 504 | const char *home = cbm_get_home_dir(); |
| 505 | if (home) { |
| 506 | snprintf(buf, sizeof(buf), "%s/AppData/Local", home); |
| 507 | return buf; |
| 508 | } |
| 509 | return NULL; |
| 510 | #else |
| 511 | return cbm_app_config_dir(); |
| 512 | #endif |
| 513 | } |
| 514 | |
| 515 | /* ── Cache directory ────────────────────────── */ |
| 516 | |