diff options
| author | Rodney W. Grimes <rgrimes@FreeBSD.org> | 1995-06-11 19:33:05 +0000 |
|---|---|---|
| committer | Rodney W. Grimes <rgrimes@FreeBSD.org> | 1995-06-11 19:33:05 +0000 |
| commit | d3628763db3974826e46a036aa54333147fbe238 (patch) | |
| tree | ba998dfb4fcad03e00a5cbf58e2a0ad648bab6e6 /release/sysinstall/variable.c | |
| parent | 67eb1e0ed1fb11c703392e562440c67d3b44b094 (diff) | |
Notes
Diffstat (limited to 'release/sysinstall/variable.c')
| -rw-r--r-- | release/sysinstall/variable.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/release/sysinstall/variable.c b/release/sysinstall/variable.c index d2b979916773..9cf6742683a1 100644 --- a/release/sysinstall/variable.c +++ b/release/sysinstall/variable.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: variable.c,v 1.4 1995/05/27 10:47:44 jkh Exp $ + * $Id: variable.c,v 1.5.2.2 1995/06/01 21:04:03 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -50,6 +50,14 @@ make_variable(char *var, char *value) { Variable *newvar; + /* First search to see if it's already there */ + for (newvar = VarHead; newvar; newvar = newvar->next) { + if (!strcmp(newvar->name, var)) { + strncpy(newvar->value, value, VAR_VALUE_MAX); + setenv(var, value, 1); + return; + } + } setenv(var, value, 1); newvar = (Variable *)safe_malloc(sizeof(Variable)); strncpy(newvar->name, var, VAR_NAME_MAX); @@ -57,7 +65,8 @@ make_variable(char *var, char *value) newvar->next = VarHead; VarHead = newvar; setenv(newvar->name, newvar->value, 1); - msgInfo("Set %s to %s", newvar->name, newvar->value); + if (isDebug()) + msgDebug("Setting variable %s to %s\n", newvar->name, newvar->value); } void |
