diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-06-24 10:28:01 -0400 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-06-24 10:28:01 -0400 |
| commit | 8d3f0b11ce4a2acb1922ce1906e4ebeb87d4f69f (patch) | |
| tree | 96f6ab8118ceb0672a1ed8354795f0191cfbaefe | |
| parent | e3924adbf3de259023597af4c1f5a52199b71543 (diff) | |
| download | stasis-8d3f0b11ce4a2acb1922ce1906e4ebeb87d4f69f.tar.gz | |
Remove dead code
* Fix wording in comment
| -rw-r--r-- | src/conda.c | 7 |
1 files 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); |
