From e644aec12e3798523c26b8ccc67ab5357af4bb1f Mon Sep 17 00:00:00 2001 From: ptt Date: Wed, 17 Jul 2002 17:16:44 +0000 Subject: *** empty log message *** git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@418 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- util/indexuser.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'util') 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; } -- cgit v1.2.3