diff options
author | Tomas Mraz <tmraz@redhat.com> | 2011-12-06 21:58:08 +0100 |
---|---|---|
committer | Tomas Mraz <tmraz@redhat.com> | 2011-12-06 21:58:08 +0100 |
commit | 57d0ae8d95b6dbefbbb35f6c7839f6a32e6cc97d (patch) | |
tree | f742596aaa38f989ac123bdad8a9147ca96e0cf3 /src | |
parent | f717780594c26f4c6269f41ae8b987fd2745eec4 (diff) | |
download | libpwquality-57d0ae8d95b6dbefbbb35f6c7839f6a32e6cc97d.tar.gz |
Fix configuration file parsing.
Diffstat (limited to 'src')
-rw-r--r-- | src/settings.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/settings.c b/src/settings.c index 3e45f1c..4e27113 100644 --- a/src/settings.c +++ b/src/settings.c @@ -122,6 +122,7 @@ pwquality_read_config(pwquality_settings_t *pwq, const char *cfgfile, void **aux size_t len; char *ptr; char *name; + int eq; len = strlen(linebuf); if (linebuf[len - 1] != '\n' && !feof(f)) { @@ -158,9 +159,15 @@ pwquality_read_config(pwquality_settings_t *pwq, const char *cfgfile, void **aux } ++ptr; } + + eq = 0; while (*ptr != '\0') { - if (!isspace(*ptr)) { - break; + if (*ptr != '=' || eq) { + if (!isspace(*ptr)) { + break; + } + } else { + eq = 1; } ++ptr; } |