diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-05-02 00:46:01 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-05-02 00:46:01 -0400 |
commit | 9cbfef97af7491c42ba7a17b3805165f539b20b2 (patch) | |
tree | d44b4cf5160b3cb954425c8ba4cdd810f77190c3 | |
parent | d4ff44ab8db091ca0e7d1c8caa74f32784e672ef (diff) | |
download | ohmycal-9cbfef97af7491c42ba7a17b3805165f539b20b2.tar.gz |
Clean up
* Add comment
* Remove unused code
-rw-r--r-- | src/conda.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conda.c b/src/conda.c index fda2eea..efb42fa 100644 --- a/src/conda.c +++ b/src/conda.c @@ -121,9 +121,10 @@ int conda_activate(const char *root, const char *env_name) { char buf[OMC_BUFSIZ] = {0}; int ch = 0; size_t z = 0; + // We are ingesting output from "env -0", 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) { - ch = 0; break; } buf[z] = (char) ch; @@ -134,7 +135,7 @@ int conda_activate(const char *root, const char *env_name) { if (!strlen(buf)) { continue; } - //printf("\e[0m[%d] %s\e[0m\n", i, buf); + char **part = split(buf, "=", 1); if (!part) { perror("unable to split environment variable buffer"); |