CONFIG

dronnikov at gmail.com dronnikov at gmail.com
Thu Jul 17 18:41:00 UTC 2008


0. Recent patch by Bernhard made mdev fail testsuite. Analysis led to config_open() which should not
fclose(unopened_file) and free(unalloced_memory), IMO.

1. Reduced the number of parameters. The idea is to have flags for finer "delimiting" control.
Since comment is a char, I packed it to the very first char of delims. Quite elegant and intuitive IMHO.

2. Introduced PARSE_DONT_TRIM flag. The problem was: how to handle the leading and trailing delimiters
when PARSE_DONT_REDUCE is set? If a delimiter is treated as non-reduceable then why on earth the leading
(and trailing) delimiters are just thrown? Thus the new flag. Those who wants to deal with every delimiter
should set both PARSE_DONT_TRIM and PARSE_DONT_REDUCE flags.

3. When config_read() returns 0 there NOTHING has been parsed! So using tokens[0] segfaults. Thus changed the
failure return value from -1 to 0 (no need to know whether there were no lines, or all lines were empty, IMO)
and conditions in applets.

Please comment and consider applying.

TIA,
--
Vladimir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 62.patch
Type: application/octet-stream
Size: 6419 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20080717/2d700583/attachment-0002.obj 


More information about the busybox mailing list