Changeset 1429 in MondoRescue
- Timestamp:
- May 10, 2007, 12:49:13 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/lib/mr_conf.c
r1428 r1429 287 287 size_t k; /*conditioned iterator for tmp_buffer */ 288 288 bool found_quote = FALSE; 289 bool found_comment = FALSE; 289 290 290 291 length = strlen(buffer); … … 295 296 while (i < length) { 296 297 /* Handle quotes to detect strings */ 297 if ( buffer[i] == '"') {298 if ((buffer[i] == '"') && (! found_comment)) { 298 299 if (found_quote) { 299 300 found_quote = FALSE; … … 302 303 } 303 304 } 304 if ((buffer[i] != MRCONF_COMM_CHAR) || (found_quote)) { 305 /* Handle start of comment - only when not in a string */ 306 if (buffer[i] == MRCONF_COMM_CHAR) { 307 if (found_quote) { 308 found_comment = FALSE; 309 } else { 310 found_comment = TRUE; 311 } 312 } 313 /* Comments end with EOL */ 314 if (buffer[i] == '\n') { 315 found_comment = FALSE; 316 } 317 if (! found_comment) { 305 318 k++; 306 319 i++; 307 320 } else { 308 /* Skip comment as it's not inside a string*/321 /* Skip comment */ 309 322 while ((buffer[i] != '\n') && (buffer[i] != (char) 0)) { 310 323 i++;
Note:
See TracChangeset
for help on using the changeset viewer.