From: Richard W.M. Jones Date: Sun, 18 Dec 2016 14:19:13 +0000 (+0000) Subject: Fix documentation of mexp_spawnl to include terminating NULL. X-Git-Tag: v1.1~6 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=4878ec575b630d1fc5bf1c183d805c42b67a4191;p=miniexpect.git Fix documentation of mexp_spawnl to include terminating NULL. Code is correct, but the documentation was wrong. --- diff --git a/miniexpect.pod b/miniexpect.pod index 9fe235e..3c3be82 100644 --- a/miniexpect.pod +++ b/miniexpect.pod @@ -12,7 +12,7 @@ miniexpect - A very simple expect library for C. #include mexp_h *h; - h = mexp_spawnl ("ssh", "ssh", "host"); + h = mexp_spawnl ("ssh", "ssh", "host", NULL); switch (mexp_expect (h, regexps, ovector, ovecsize)) { ... } @@ -60,8 +60,9 @@ B This creates a subprocess running the external program C (the current C<$PATH> is searched unless you give an absolute path). -C are the arguments to the program. Usually the first -argument should be the name of the program. +C are the arguments to the program. You should terminate +the list of arguments with C. Usually the first argument should +be the name of the program. The return value is a handle (see next section). @@ -70,11 +71,11 @@ the error is available in C. For example, to run an ssh subprocess you could do: - h = mexp_spawnl ("ssh", "ssh", "-l", "root", "host"); + h = mexp_spawnl ("ssh", "ssh", "-l", "root", "host", NULL); or to run a particular ssh binary: - h = mexp_spawnl ("/usr/local/bin/ssh", "ssh", "-l", "root", "host"); + h = mexp_spawnl ("/usr/local/bin/ssh", "ssh", "-l", "root", "host", NULL); An alternative to C is: