The previous version of sysctl had the form: sysctl -p [file] In other words, it required a space between the -p and the [file]. Omitting the space would lead to an error. The new version though is the opposite: sysctl -p[file] In other words, it requires there to not be a space. Considering the old behavior has been around for a decade, and runtime checking for this mismatch in behavior is silly, and supporting the old syntax is trivial, add support for it. Signed-off-by: Mike Frysinger <vapier@xxxxxxxxxx> --- sysctl.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sysctl.c b/sysctl.c index 6613e9a..08d305c 100644 --- a/sysctl.c +++ b/sysctl.c @@ -641,7 +641,7 @@ int main(int argc, char *argv[]) bool preloadfileOpt = false; int ReturnCode = 0; int c; - const char *preloadfile = DEFAULT_PRELOAD; + const char *preloadfile = NULL; enum { DEPRECATED_OPTION = CHAR_MAX + 1, @@ -744,13 +744,16 @@ int main(int argc, char *argv[]) } } + argc -= optind; + argv += optind; + if (DisplayAllOpt) return DisplayAll(PROC_PATH); - if (preloadfileOpt) + if (preloadfileOpt) { + if (!preloadfile) + preloadfile = argv[0]; return Preload(preloadfile); - - argc -= optind; - argv += optind; + } if (argc < 1) xerrx(EXIT_FAILURE, _("no variables specified\n" -- 1.7.9.7