Skip to content

Commit

Permalink
Return for-s to their previous format.
Browse files Browse the repository at this point in the history
  • Loading branch information
userwiths committed Jan 14, 2025
1 parent 07dfde0 commit 971f3e7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions common/optparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,8 @@ struct optstruct *optparse(const char *cfgfile, int argc, char **argv, int verbo
break;

buff = buffer;
for (i = 0; i < (int)strlen(buff) - 1 && (buff[i] == ' ' || buff[i] == '\t'); i++);
for (i = 0; i < (int)strlen(buff) - 1 && (buff[i] == ' ' || buff[i] == '\t'); i++)
;
buff += i;
line++;
if (strlen(buff) <= 2 || buff[0] == '#')
Expand All @@ -1036,9 +1037,11 @@ struct optstruct *optparse(const char *cfgfile, int argc, char **argv, int verbo
}
name = buff;
*pt++ = 0;
for (i = 0; i < (int)strlen(pt) - 1 && (pt[i] == ' ' || pt[i] == '\t'); i++);
for (i = 0; i < (int)strlen(pt) - 1 && (pt[i] == ' ' || pt[i] == '\t'); i++)
;
pt += i;
for (i = strlen(pt); i >= 1 && (pt[i - 1] == ' ' || pt[i - 1] == '\t' || pt[i - 1] == '\n'); i--);
for (i = strlen(pt); i >= 1 && (pt[i - 1] == ' ' || pt[i - 1] == '\t' || pt[i - 1] == '\n'); i--)
;
if (!i) {
if (verbose)
fprintf(stderr, "ERROR: Missing argument for option at %s:%d\n", cfgfile, line);
Expand Down

0 comments on commit 971f3e7

Please sign in to comment.