From 4878ec575b630d1fc5bf1c183d805c42b67a4191 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 18 Dec 2016 14:19:13 +0000 Subject: [PATCH] Fix documentation of mexp_spawnl to include terminating NULL. Code is correct, but the documentation was wrong. --- miniexpect.pod | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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: -- 1.8.3.1