Skip to content

Commit

Permalink
add option for FOR command
Browse files Browse the repository at this point in the history
  • Loading branch information
liyanboy74 committed Dec 15, 2021
1 parent ed7ede8 commit 0c72f0f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions htmixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ void cheack_loops(char * FileName)
FILE *fp,*fpt;
size_t s,i,k,l;

int loop_s=0,loop_e=0,loop_c=0;
int loop_s=0,loop_e=0,loop_c=0,loop_p=0;
size_t loop_start_loc,loop_end_loc;
size_t len=0;

Expand All @@ -237,12 +237,12 @@ void cheack_loops(char * FileName)
i+=2;
if(strncmp(&buff[i],"FOR(",4)==0)
{
sscanf(&buff[i],"FOR(%d,%d)",&loop_s,&loop_e);
sscanf(&buff[i],"FOR(%d,%d,%d)",&loop_s,&loop_e,&loop_p);
while(buff[i++]!=')');
len=get_me_out(&buff[i]);
loop_start_loc=i;
loop_end_loc=i+len;
for(loop_c=loop_s;loop_c<loop_e;loop_c++,for_f=0,for_c=0)
for(loop_c=loop_s;loop_c!=loop_e;for_f=0,for_c=0)
{
for(k=0;k<len;k++)
{
Expand Down Expand Up @@ -281,8 +281,12 @@ void cheack_loops(char * FileName)
}
else fwrite(&buff[i+k],1,1,fpt);
}

if(loop_p==0)loop_c++;
else loop_c+=loop_p;
}
i=loop_end_loc+2;
loop_p=0;
}
else
{
Expand Down

0 comments on commit 0c72f0f

Please sign in to comment.