void Add_Combine(board,fileinfo,yinyan)
char *board;
struct fileheader *fileinfo;
int yinyan;
{
FILE *fp;
char buf[STRLEN];
char temp2[1024];
sprintf(buf,"tmp/%s.combine",currentuser.userid);
fp=fopen(buf,"at");
fprintf(fp,";32m□──────────────────────────────────────□0;1m\n");
{
FILE *fp1;
char buf[80];
char *s_ptr,*e_ptr;
int blankline=0;
setbfile(buf,board,fileinfo->filename);
fp1=fopen(buf,"rt");
if(fp1==NULL)
{ fclose(fp);
return;
} //防止文本丢失而产生断线
if (fgets(temp2, 256, fp1)!=NULL)
{ e_ptr=strchr(temp2,',');
if (e_ptr!=NULL)
*e_ptr='\0';
s_ptr=&temp2[7];
fprintf(fp, " 0;1;36m%s 0;1m于",s_ptr);
}
fgets(temp2, 256, fp1);
if (fgets(temp2, 256, fp1)!=NULL)
{
e_ptr=strchr(temp2,')'); //此处原来是strchr(temp2,',')
//修改原因:WWW发文或者news发过来的文章没有','
if (e_ptr!=NULL)
*(e_ptr)='\0';
s_ptr=strchr(temp2,'(');
if (s_ptr==NULL)
s_ptr=temp2;
else
s_ptr++;
fprintf(fp, " ;36m%s0;1m 提到:\n",s_ptr);
}
if(strncmp(temp2,"转信站: ",8)==0)
fputs(temp2,fp);
while (!feof(fp1))
{
fgets(temp2, 256, fp1);
if ((unsigned)*temp2<'\x1b')
{ if (blankline)
continue;
else
blankline=1;
}
else blankline=0;
if(!yinyan)
{ if((strstr(temp2, "【"))|| + (*temp2==':'))
continue;
}
if (strncmp(temp2,"--\n",3)==0)
break;
fputs(temp2, fp);
}
fclose(fp1);
}
fprintf(fp,"\n" );
fclose(fp);
}
--
FROM 202.113.9.180