diff options
author | William Hubbs <williamh@gentoo.org> | 2012-01-16 12:11:29 -0600 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2012-01-16 12:11:29 -0600 |
commit | d729f9d0f2d773c3cddc2f3004364d831081f692 (patch) | |
tree | ff4b02081e17a8a9b82dee2672a03b792e2abb5d /src/librc | |
parent | fdc8849e5686a13c6cb5401af5805ae649035eb0 (diff) |
style fixes
Diffstat (limited to 'src/librc')
-rw-r--r-- | src/librc/librc-misc.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/librc/librc-misc.c b/src/librc/librc-misc.c index a5daa07e..3b91e48b 100644 --- a/src/librc/librc-misc.c +++ b/src/librc/librc-misc.c @@ -215,10 +215,11 @@ rc_config_list(const char *file) librc_hidden_def(rc_config_list) /* - * Override some specific rc.conf options via kernel cmdline + * Override some specific rc.conf options on the kernel command line */ #ifdef __linux__ -static RC_STRINGLIST *rc_config_override(RC_STRINGLIST *config) { +static RC_STRINGLIST *rc_config_override(RC_STRINGLIST *config) +{ RC_STRINGLIST *overrides; RC_STRING *cline, *override, *config_np; char *tmp = NULL; @@ -228,7 +229,7 @@ static RC_STRINGLIST *rc_config_override(RC_STRINGLIST *config) { overrides = rc_stringlist_new(); - /* A list of variables which may be overriden through cmdline */ + /* A list of variables which may be overridden on the kernel command line */ rc_stringlist_add(overrides, "rc_parallel"); TAILQ_FOREACH(override, overrides, entries) { @@ -242,14 +243,18 @@ static RC_STRINGLIST *rc_config_override(RC_STRINGLIST *config) { } if (value != NULL) { - len = (varlen + strlen(value) + 2); + len = varlen + strlen(value) + 2; tmp = xmalloc(sizeof(char) * len); snprintf(tmp, len, "%s=%s", override->value, value); } - /* Whenever necessary remove the old config entry first to prevent duplicates */ + /* + * Whenever necessary remove the old config entry first to prevent + * duplicates + */ TAILQ_FOREACH_SAFE(cline, config, entries, config_np) { - if (strncmp(override->value, cline->value, varlen) == 0 && cline->value[varlen] == '=') { + if (strncmp(override->value, cline->value, varlen) == 0 + && cline->value[varlen] == '=') { rc_stringlist_delete(config, cline->value); break; } @@ -261,9 +266,7 @@ static RC_STRINGLIST *rc_config_override(RC_STRINGLIST *config) { free(tmp); free(value); } - rc_stringlist_free(overrides); - return config; } #endif |