| 551 | } |
| 552 | |
| 553 | const char *cbm_app_local_dir(void) { |
| 554 | #ifdef _WIN32 |
| 555 | static CBM_TLS char buf[CBM_SZ_1K]; |
| 556 | char tmp[CBM_SZ_256] = ""; |
| 557 | cbm_safe_getenv("LOCALAPPDATA", tmp, sizeof(tmp), NULL); |
| 558 | if (tmp[0]) { |
| 559 | snprintf(buf, sizeof(buf), "%s", tmp); |
| 560 | cbm_normalize_path_sep(buf); |
| 561 | return buf; |
| 562 | } |
| 563 | const char *home = cbm_get_home_dir(); |
| 564 | if (home) { |
| 565 | snprintf(buf, sizeof(buf), "%s/AppData/Local", home); |
| 566 | return buf; |
| 567 | } |
| 568 | return NULL; |
| 569 | #else |
| 570 | return cbm_app_config_dir(); |
| 571 | #endif |
| 572 | } |
| 573 | |
| 574 | /* ── Cache directory ────────────────────────── */ |
| 575 | |