I changed some indentation

This commit is contained in:
Kat R. 2022-10-09 11:35:54 -05:00
parent 4bee47593e
commit 4025416fd1

View file

@ -27,20 +27,20 @@ int main(int argc, char ** argv) {
}
else {
while(is_integer(argv[j]) && j < (argc - 1)) {
num_tab_stops++;
i++;
j++;
num_tab_stops++;
i++;
j++;
}
tab_stops = calloc(num_tab_stops, sizeof(*tab_stops));
for(j = 2; j < num_tab_stops + 2; j++) {
tab_stops[j-2] = stoi_mini(argv[j]);
tab_stops[j-2] = stoi_mini(argv[j]);
}
}
}
else if(argv[1][0] == '-' && argv[1][1] == 't' &&
argv[1][2] <= '9' && argv[1][2] >= '0'){
argv[1][2] <= '9' && argv[1][2] >= '0'){
char * str = strtok(argv[1], "t");
str = strtok(NULL, "\0");
num_tab_stops = comma_list_num_stops(str);
@ -62,38 +62,38 @@ int main(int argc, char ** argv) {
else {
cur_stop = 0; col_pos = 0;
for(c = fgetc(current_file); c != EOF; c = fgetc(current_file)) {
if(c == '\t') {
if(num_tab_stops == 1) {
cur_stop++;
printf(" "); col_pos++;
while(col_pos % *tab_stops != 0) {
printf(" "); col_pos++;
}
}
else {
if(cur_stop >= num_tab_stops) {
printf(" ");
col_pos++;
cur_stop++;
}
else {
printf(" "); col_pos++;
while(col_pos % tab_stops[cur_stop] != 0) {
printf(" "); col_pos++;
}
cur_stop++;
}
}
}
else if(c == '\n') {
printf("%c", c);
col_pos = 0;
cur_stop = 0;
}
else {
printf("%c", c);
col_pos++;
}
if(c == '\t') {
if(num_tab_stops == 1) {
cur_stop++;
printf(" "); col_pos++;
while(col_pos % *tab_stops != 0) {
printf(" "); col_pos++;
}
}
else {
if(cur_stop >= num_tab_stops) {
printf(" ");
col_pos++;
cur_stop++;
}
else {
printf(" "); col_pos++;
while(col_pos % tab_stops[cur_stop] != 0) {
printf(" "); col_pos++;
}
cur_stop++;
}
}
}
else if(c == '\n') {
printf("%c", c);
col_pos = 0;
cur_stop = 0;
}
else {
printf("%c", c);
col_pos++;
}
}
fclose(current_file);
}