diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-13 14:40:00 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-13 14:40:00 +0000 |
| commit | 8fc9c88304fde65d6c3a619c3aee7e6e00540695 (patch) | |
| tree | 0e370a3c0a6610028234f1f0da22c1c4ac732699 /src/utils | |
| parent | edb3d8013e62dbdc1f093a8781f1833e11dfbdda (diff) | |
Added a few fixes to #34
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/utils.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/utils/utils.c b/src/utils/utils.c index 5f41f44..2645b49 100644 --- a/src/utils/utils.c +++ b/src/utils/utils.c @@ -490,6 +490,29 @@ char *load_file(const char *fn) FILE *f = fopen(fn, "rb"); if (!f) { + char *root = getenv("ZC_ROOT"); + if (root) + { + char path[1024]; + snprintf(path, sizeof(path), "%s/%s", root, fn); + f = fopen(path, "rb"); + } + } + if (!f) + { + char path[1024]; + snprintf(path, sizeof(path), "/usr/local/share/zenc/%s", fn); + f = fopen(path, "rb"); + } + if (!f) + { + char path[1024]; + snprintf(path, sizeof(path), "/usr/share/zenc/%s", fn); + f = fopen(path, "rb"); + } + + if (!f) + { return 0; } fseek(f, 0, SEEK_END); |
