/* read the file */
rc = getfile(path, content, length);
if (rc >= 0) {
- /* removes any comment and join lines */
+ /* removes any comment and join continued lines */
st = 0;
read = write = *content;
for (;;) {
break;
switch (st) {
case 0:
+ /* state 0: begin of a line */
if (c == ';' || c == '#') {
st = 3; /* removes lines starting with ; or # */
break;
st = 1;
/*@fallthrough@*/
case 1:
+ /* state 1: emitting a normal line */
if (c == '\\')
st = 2;
else {
}
break;
case 2:
+ /* state 2: character after '\' */
if (c == '\n')
c = ' ';
else
*write++ = '\\';
goto enter_state_1;
case 3:
+ /* state 3: inside a comment, wait its end */
if (c == '\n')
st = 0;
break;