claenups for previous commit
[oweals/busybox.git] / procps / sysctl.c
index ef1a1b99f8c31c48608773bdb32ecb986bc8e8de..827e09cce092880d163cc1c0c706f3115a229b57 100644 (file)
@@ -16,7 +16,7 @@
 //config:      help
 //config:      Configure kernel parameters at runtime.
 
-//applet:IF_BB_SYSCTL(APPLET(sysctl, BB_DIR_SBIN, BB_SUID_DROP))
+//applet:IF_BB_SYSCTL(APPLET_NOEXEC(sysctl, sysctl, BB_DIR_SBIN, BB_SUID_DROP, sysctl))
 
 //kbuild:lib-$(CONFIG_BB_SYSCTL) += sysctl.o
 
@@ -247,15 +247,16 @@ static int sysctl_handle_preload_file(const char *filename)
        /* Must do it _after_ config_open(): */
        xchdir("/proc/sys");
 
-//TODO: ';' is comment char too
-//TODO: <space><tab><space>#comment is also comment, not strictly 1st char only
        parse_flags = 0;
        parse_flags &= ~PARSE_COLLAPSE;   // NO (var==val is not var=val) - treat consecutive delimiters as one
        parse_flags &= ~PARSE_TRIM;       // NO - trim leading and trailing delimiters
        parse_flags |= PARSE_GREEDY;      // YES - last token takes entire remainder of the line
        parse_flags &= ~PARSE_MIN_DIE;    // NO - die if < min tokens found
        parse_flags &= ~PARSE_EOL_COMMENTS; // NO (only first char) - comments are recognized even if not first char
-       while (config_read(parser, token, 2, 2, "#=", parse_flags)) {
+       parse_flags |= PARSE_ALT_COMMENTS;// YES - two comment chars: ';' and '#'
+       /* <space><tab><space>#comment is also comment, not strictly 1st char only */
+       parse_flags |= PARSE_WS_COMMENTS; // YES - comments are recognized even if there is whitespace before
+       while (config_read(parser, token, 2, 2, ";#=", parse_flags)) {
                char *tp;
 
                trim(token[1]);