summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomas Mraz <tmraz@redhat.com>2011-12-06 21:58:08 +0100
committerTomas Mraz <tmraz@redhat.com>2011-12-06 21:58:08 +0100
commit57d0ae8d95b6dbefbbb35f6c7839f6a32e6cc97d (patch)
treef742596aaa38f989ac123bdad8a9147ca96e0cf3 /src
parentf717780594c26f4c6269f41ae8b987fd2745eec4 (diff)
downloadlibpwquality-57d0ae8d95b6dbefbbb35f6c7839f6a32e6cc97d.tar.gz
Fix configuration file parsing.
Diffstat (limited to 'src')
-rw-r--r--src/settings.c11
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;
}