diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2016-10-24 20:31:29 -0700 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2016-10-24 20:31:29 -0700 |
commit | b3ab365fda1a65f2c3535cda15de885bfa9de814 (patch) | |
tree | 8bd79452c1af07034d54aaf4f4ec04d873e85dc5 /include/fuse.h | |
parent | 1d9f26f3736cc4703c2e988d87f5dd119bcd736d (diff) | |
download | libfuse-b3ab365fda1a65f2c3535cda15de885bfa9de814.tar.gz |
fuse_session_new(): don't accept empty argv, check argv[0]
This should help avoid people to accidentally put options
into argv[0].
Fixes #100.
Diffstat (limited to 'include/fuse.h')
-rw-r--r-- | include/fuse.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/include/fuse.h b/include/fuse.h index e8ff936..312818e 100644 --- a/include/fuse.h +++ b/include/fuse.h @@ -748,11 +748,13 @@ struct fuse_context { * fuse_main() accepts all options that can be passed to * fuse_parse_cmdline(), fuse_new(), or fuse_session_new(). * - * Normally, fuse_main() includes a basic ``usage: `` message in the - * --help output. However, if argv[0] is an empty string, the usage - * message is suppressed. This can be used by file systems to print - * their own usage line first. See hello.c for an example of how to do - * this. + * Option parsing skips argv[0], which is assumed to contain the + * program name. This element must always be present and is used to + * construct a basic ``usage: `` message for the --help + * output. argv[0] may also be set to the empty string. In this case + * the usage message is suppressed. This can be used by file systems + * to print their own usage line first. See hello.c for an example of + * how to do this. * * Note: this is currently implemented as a macro. * @@ -785,6 +787,12 @@ struct fuse_context { * If the --help option is specified, the function writes a help text * to stdout and returns NULL. * + * Option parsing skips argv[0], which is assumed to contain the + * program name. This element must always be present and is used to + * construct a basic ``usage: `` message for the --help output. If + * argv[0] is set to the empty string, no usage message is included in + * the --help output. + * * If an unknown option is passed in, an error message is written to * stderr and the function returns NULL. * |