Diff for libplaton/utils/getmails/getmails.c between version 1.8 and 1.9
| version 1.8, 2003/04/23 19:28:38 |
version 1.9, 2008/09/11 13:00:20 |
| Line 38 int main(int argc,char*argv[]) |
|
| Line 38 int main(int argc,char*argv[]) |
|
| } |
} |
| |
|
| /* Files check */ |
/* Files check */ |
| { |
if (0) { |
| FILE*f; |
FILE*f; |
| if ((f=fopen(argv[1],INPUT_FMODE))==NULL) { |
if ((f=fopen(argv[1],INPUT_FMODE))==NULL) { |
| printf("Can't open input file. [%s]\n",argv[1]); |
printf("Can't open input file. [%s]\n",argv[1]); |
| Line 107 int extract(const char *fin_name, const |
|
| Line 107 int extract(const char *fin_name, const |
|
| char buf[BUFSIZE],*xbuf; |
char buf[BUFSIZE],*xbuf; |
| FILE*fin,*fout; |
FILE*fin,*fout; |
| |
|
| if ((fin=fopen(fin_name,INPUT_FMODE))==NULL)return(1); |
if (! strcmp(fin_name, "-") || ! strcmp(fin_name, "stdin")) { |
| if ((fout=fopen(fout_name,OUTPUT_FMODE))==NULL)return(1); |
fin = stdin; |
| |
} else { |
| |
if ((fin=fopen(fin_name,INPUT_FMODE))==NULL)return(1); |
| |
} |
| |
if (! strcmp(fout_name, "-") || ! strcmp(fout_name, "stdout")) { |
| |
fout = stdout; |
| |
} else { |
| |
if ((fout=fopen(fout_name,OUTPUT_FMODE))==NULL)return(1); |
| |
} |
| |
|
| memset((void*)buf,'\0',sizeof(buf)); |
memset((void*)buf,'\0',sizeof(buf)); |
| while (fscanf(fin,"%300s",buf)!=EOF) { |
while (fscanf(fin,"%300s",buf)!=EOF) { |
| Line 136 int extract(const char *fin_name, const |
|
| Line 144 int extract(const char *fin_name, const |
|
| memset((void*)buf,'\0',sizeof(buf)); |
memset((void*)buf,'\0',sizeof(buf)); |
| } |
} |
| |
|
| fclose(fin); |
if (fin != stdin) { |
| fclose(fout); |
fclose(fin); |
| |
} |
| |
if (fout != stdout) { |
| |
fclose(fout); |
| |
} |
| |
|
| return(0); |
return(0); |
| } |
} |
Platon Group <platon@platon.org> http://platon.org/
|
|