From 8d3f0b11ce4a2acb1922ce1906e4ebeb87d4f69f Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 24 Jun 2024 10:28:01 -0400 Subject: Remove dead code * Fix wording in comment --- src/conda.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/conda.c b/src/conda.c index 90a8587..1e8b03f 100644 --- a/src/conda.c +++ b/src/conda.c @@ -169,12 +169,12 @@ int conda_activate(const char *root, const char *env_name) { perror(logfile); return -1; } - int i = 0; + while (!feof(fp)) { char buf[STASIS_BUFSIZ] = {0}; int ch = 0; size_t z = 0; - // We are ingesting output from "env -0", can't use fgets() + // We are ingesting output from "env -0" and can't use fgets() // Copy each character into the buffer until we encounter '\0' or EOF while (z < sizeof(buf) && (ch = (int) fgetc(fp)) != 0) { if (ch == EOF) { @@ -196,15 +196,12 @@ int conda_activate(const char *root, const char *env_name) { } if (!part[0]) { msg(STASIS_MSG_WARN | STASIS_MSG_L1, "Invalid environment variable key ignored: '%s'\n", buf); - i++; } else if (!part[1]) { msg(STASIS_MSG_WARN | STASIS_MSG_L1, "Invalid environment variable value ignored: '%s'\n", buf); - i++; } else { setenv(part[0], part[1], 1); } GENERIC_ARRAY_FREE(part); - i++; } fclose(fp); remove(logfile); -- cgit