diff options
| author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2026-04-28 11:45:10 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-28 11:45:10 -0400 |
| commit | 10f13b36560c5112554c54d8958081b7aa518050 (patch) | |
| tree | bd27866c4352de38ebc5b13f8208768d576ae904 /src/cli/stasis_indexer/helpers.c | |
| parent | 017bc273aedf3f20512beeb78a2f513913e56305 (diff) | |
| parent | d761cc976a8d645e61d23f6e43dcfec1a7fdb061 (diff) | |
| download | stasis-10f13b36560c5112554c54d8958081b7aa518050.tar.gz | |
Merge pull request #137 from jhunkeler/bughunt-1001
Bug Hunt 0x1001
Diffstat (limited to 'src/cli/stasis_indexer/helpers.c')
| -rw-r--r-- | src/cli/stasis_indexer/helpers.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cli/stasis_indexer/helpers.c b/src/cli/stasis_indexer/helpers.c index 23e4f5a..425d209 100644 --- a/src/cli/stasis_indexer/helpers.c +++ b/src/cli/stasis_indexer/helpers.c @@ -121,7 +121,11 @@ int pandoc_exec(const char *in_file, const char *out_file, const char *css_file, // Converts a markdown file to html char cmd[STASIS_BUFSIZ] = {0}; strncpy(cmd, "pandoc ", sizeof(cmd) - 1); + cmd[sizeof(cmd) - 1] = '\0'; + strncat(cmd, pandoc_versioned_args, sizeof(cmd) - strlen(cmd) - 1); + cmd[sizeof(cmd) - 1] = '\0'; + if (css_file && strlen(css_file)) { strncat(cmd, "--css ", sizeof(cmd) - strlen(cmd) - 1); strncat(cmd, css_file, sizeof(cmd) - strlen(cmd) - 1); @@ -152,6 +156,7 @@ int micromamba_configure(const struct Delivery *ctx, struct MicromambaInfo *m) { } m->conda_prefix = globals.conda_install_prefix; m->micromamba_prefix = micromamba_prefix; + m->download_dir = ctx->storage.tmpdir; const size_t pathvar_len = strlen(getenv("PATH")) + strlen(m->micromamba_prefix) + strlen(m->conda_prefix) + 3 + 4 + 1; // ^^^^^^^^^^^^^^^^^^ @@ -397,8 +402,11 @@ int write_manifest(const char *path, char **exclude_path, FILE *fp) { } char filepath[PATH_MAX] = {0}; strncpy(filepath, path, PATH_MAX - 1); + filepath[PATH_MAX - 1] = '\0'; + strncat(filepath, "/", sizeof(filepath) - strlen(filepath) - 1); strncat(filepath, rec->d_name, sizeof(filepath) - strlen(filepath) - 1); + if (rec->d_type == DT_DIR) { write_manifest(filepath, exclude_path, fp); continue; |
