diff options
author | Bruce Momjian <bruce@momjian.us> | 2004-08-29 05:07:03 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2004-08-29 05:07:03 +0000 |
commit | b6b71b85bc45b49005b5aec87cba2c33fc8baf49 (patch) | |
tree | c23dbd1dbc43972a8e48327c8a771baf36952f3d /src/port/unsetenv.c | |
parent | 90cb9c305140684b2b00c739b724f67915e11404 (diff) | |
download | postgresql-b6b71b85bc45b49005b5aec87cba2c33fc8baf49.tar.gz postgresql-b6b71b85bc45b49005b5aec87cba2c33fc8baf49.zip |
Pgindent run for 8.0.
Diffstat (limited to 'src/port/unsetenv.c')
-rw-r--r-- | src/port/unsetenv.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/port/unsetenv.c b/src/port/unsetenv.c index 1f57c515349..2f29f57521b 100644 --- a/src/port/unsetenv.c +++ b/src/port/unsetenv.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/port/unsetenv.c,v 1.2 2004/08/29 04:13:12 momjian Exp $ + * $PostgreSQL: pgsql/src/port/unsetenv.c,v 1.3 2004/08/29 05:07:02 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -19,22 +19,23 @@ void unsetenv(const char *name) { - char *envstr; + char *envstr; if (getenv(name) == NULL) return; /* no work */ /* - * The technique embodied here works if libc follows the Single Unix Spec - * and actually uses the storage passed to putenv() to hold the environ - * entry. When we clobber the entry in the second step we are ensuring - * that we zap the actual environ member. However, there are some libc - * implementations (notably recent BSDs) that do not obey SUS but copy - * the presented string. This method fails on such platforms. Hopefully - * all such platforms have unsetenv() and thus won't be using this hack. + * The technique embodied here works if libc follows the Single Unix + * Spec and actually uses the storage passed to putenv() to hold the + * environ entry. When we clobber the entry in the second step we are + * ensuring that we zap the actual environ member. However, there are + * some libc implementations (notably recent BSDs) that do not obey + * SUS but copy the presented string. This method fails on such + * platforms. Hopefully all such platforms have unsetenv() and thus + * won't be using this hack. * - * Note that repeatedly setting and unsetting a var using this code - * will leak memory. + * Note that repeatedly setting and unsetting a var using this code will + * leak memory. */ envstr = (char *) malloc(strlen(name) + 2); @@ -49,8 +50,8 @@ unsetenv(const char *name) strcpy(envstr, "="); /* - * This last putenv cleans up if we have multiple zero-length names - * as a result of unsetting multiple things. + * This last putenv cleans up if we have multiple zero-length names as + * a result of unsetting multiple things. */ putenv(envstr); } |