#include "bbs.h"

int ChooseAName(char *s,struct User *hoozer,struct UserKeys *hoozer2,int lflag)
{
int stat;
UWORD i;

 i=1;
 do {
     stat=Find_User_From_Name(i,s,hoozer,hoozer2);
     if(stat==0) {
         if(lflag)  AEPutStr("\r\nUser does not exist!!\r\n\r\n");
         return(FAILURE);
     }
     if(stat=CheckForAst(s)) {
         if(stat<4 || !GET_BIT(ACS_WILDCARDS)) return(FAILURE);
         AEPutStr(" Expand: ");
         AEPutStr(hoozer2->UserName);
         AEPutStr(" Correct ");
         stat=YesNo(1);
         if(stat<0)          return(stat);
         if(!stat) {
             if(AnsiColor)    AEPutStr("[A[K");
             stat=1;
             i=(hoozer2->Number)+1;
         } else  stat=0;

     } else   stat=0;
 } while(stat);
 Load_Account(hoozer2->Number,hoozer,hoozer2);
 return(1);
}
