\r
void parse_ip_log(int argc, char **argv) \r
{\r
- char *month, *year, *str, *name, *ptr, *ptr2;\r
+ char *month, *year, *str, *name, *ptr, *ptr2, *filename;\r
long traffic, traffic_month, total=0, guaranted;\r
int col, col2, y_ok, m_ok, accept_month, i=1, any_month=0;\r
char mstr[4], ystr[5];\r
FILE *f; \r
string(str,STRLEN);\r
+ string(filename,STRLEN);\r
\r
if(argv[1][1]=='l') /* -l */\r
{\r
input(str,STRLEN) \r
{\r
if(strstr(str,".log"))\r
- {\r
+ {\r
ptr=strrchr(str,'\n');\r
if(ptr) *ptr='\0';\r
- printf("Parsing %s ...",str);\r
+ sprintf(filename,"%s/%s",log_dir,str);\r
+ printf("Parsing %s ...",filename);\r
accept_month=0;\r
traffic_month=0;\r
guaranted = 0;\r
- parse(str)\r
+ parse(filename)\r
{\r
y_ok=m_ok=0; \r
valid_columns(ptr,_,'\t',col) switch(col)\r
}\r
else\r
puts(" no records.");\r
- }\r
+ }\r
}\r
sprintf(str,"%s/%s-%s.html",html_log_dir,year,month);\r
printf("Writing %s ...",str);\r