diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1999-02-01 16:40:47 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1999-02-01 16:40:47 +0000 |
| commit | e0015f1aa921e251f5955b128cd3f74389deb229 (patch) | |
| tree | efb03cea4070645589dc92f3af32559bccb6f702 | |
| parent | 67e0ebfec4851dd1b9f989ffd4831946f0dfbe74 (diff) | |
Notes
| -rw-r--r-- | release/sysinstall/config.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/release/sysinstall/config.c b/release/sysinstall/config.c index 586046a2c3aa..8a0ac7cf482c 100644 --- a/release/sysinstall/config.c +++ b/release/sysinstall/config.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: config.c,v 1.115.2.1 1999/01/27 02:51:29 jkh Exp $ + * $Id: config.c,v 1.115.2.2 1999/01/31 13:55:04 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -395,13 +395,11 @@ configRC_conf(char *config) for (v = VarHead; v; v = v->next) { for (i = 0; i < nlines; i++) { /* Skip the comments & non-variable settings */ - if (lines[i][0] == '#' || !(cp = index(lines[i], '='))) { - free(lines[i]); + if (lines[i][0] == '#' || !(cp = index(lines[i], '='))) continue; - } len = strlen(v->name); - if (!strncmp(lines[i], v->name, cp - lines[i]) && (cp - lines[i]) == len) { + if (!strncmp(lines[i], v->name, cp - lines[i]) && (cp - lines[i]) == len && strcmp(cp + 1, v->value)) { char *cp2, *comment = NULL; /* If trailing comment, try and preserve it */ @@ -415,7 +413,7 @@ configRC_conf(char *config) } } free(lines[i]); - lines[i] = (char *)alloca(strlen(v->name) + strlen(v->value) + (comment ? strlen(comment) : 0) + 10); + lines[i] = (char *)malloc(strlen(v->name) + strlen(v->value) + (comment ? strlen(comment) : 0) + 10); if (comment) sprintf(lines[i], "%s=\"%s\"%s", v->name, v->value, comment); else @@ -454,10 +452,10 @@ configRC_conf(char *config) } } } - else - free(lines[i]); } } + for (i = 0; i < nlines; i++) + free(lines[i]); fclose(rcSite); } |
