diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi index 142e116ba..a56f8a30d 100644 --- a/doc/ref/posix.texi +++ b/doc/ref/posix.texi @@ -1388,17 +1388,17 @@ and @code{command-line} above. @var{argv} is an array of null-terminated strings, as in a C @code{main} function. @var{argc} is the number of strings in -@var{argv}, or if it's negative then a @code{NULL} entry in @var{argv} -marks its end. +@var{argv}, or if it's negative then a @code{NULL} in @var{argv} marks +its end. @var{first} is an extra string put at the start of the arguments, or @code{NULL} for no such extra. This is a convenient way to pass the program name after advancing @var{argv} to strip option arguments. +Eg.@: @example @{ char *progname = argv[0]; - int i; for (argv++; argv[0] != NULL && argv[0][0] == '-'; argv++) @{ /* munch option ... */ @@ -1409,7 +1409,7 @@ program name after advancing @var{argv} to strip option arguments. @end example This sort of thing is often done at startup under -@code{scm_boot_guile} with any options handled at the C level removed. +@code{scm_boot_guile} with options handled at the C level removed. The given strings are all copied, so the C data is not accessed again once @code{scm_set_program_arguments} returns. @end deftypefn