diff options
-rw-r--r-- | util/indexuser.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/util/indexuser.c b/util/indexuser.c index c626303b..bd761ccf 100644 --- a/util/indexuser.c +++ b/util/indexuser.c @@ -30,12 +30,21 @@ int main() for(j = 1; j <= MAX_USERS; j++) { passwd_query(j, &u); if(!u.userid[0]) continue; - sprintf(buf,INDEXPATH"/realname/%X",string_hash(u.realname)); - append_record(buf, &j, sizeof(j)); - sprintf(buf,INDEXPATH"/email/%X",string_hash(u.email)); - append_record(buf, &j, sizeof(j)); - sprintf(buf,INDEXPATH"/ident/%X",string_hash(u.ident)); - append_record(buf, &j, sizeof(j)); + if(u.realname[0]) + { + sprintf(buf,INDEXPATH"/realname/%X",string_hash(u.realname)); + append_record(buf, &j, sizeof(j)); + } + if(u.email[0]) + { + sprintf(buf,INDEXPATH"/email/%X",string_hash(u.email)); + append_record(buf, &j, sizeof(j)); + } + if(u.ident[0]) + { + sprintf(buf,INDEXPATH"/ident/%X",string_hash(u.ident)); + append_record(buf, &j, sizeof(j)); + } } return 0; } |