diff --git a/proc/fprocopen.3 b/proc/fprocopen.3 index 043b0b80..020a1177 100644 --- a/proc/fprocopen.3 +++ b/proc/fprocopen.3 @@ -48,13 +48,13 @@ the beginning of the file. .BR w [ ] Open a file below .I /proc/## -for writing even large buffers. The optional delimeter character +for writing even large buffers. The optional delimiter character can be one of the follwoing .BR '\ ' ,\ ',' ,\ '.' ,\ and\ ':' where the default is the colon .BR ',' . This allows to split very large input lines into pieces at this -delimeter and write each of them to the opened file below +delimiter and write each of them to the opened file below .IR /proc/## . .TP .B e diff --git a/procio.c b/procio.c index ad9b4de6..f3258ff6 100644 --- a/procio.c +++ b/procio.c @@ -249,9 +249,9 @@ ssize_t proc_write(void *c, const char *buf, size_t count) do { token = NULL; if (cookie->offset > LINELEN) - token = (char*)memrchr(cookie->buf+offset, ',', LINELEN); + token = (char*)memrchr(cookie->buf+offset, cookie->delim, LINELEN); else - token = (char*)memrchr(cookie->buf+offset, '\n', LINELEN); + token = (char*)memrchr(cookie->buf+offset, '\n', cookie->offset); if (token) *token = '\n'; else { diff --git a/sysctl.c b/sysctl.c index 2371ca9a..2172759c 100644 --- a/sysctl.c +++ b/sysctl.c @@ -465,7 +465,7 @@ static int WriteSetting(const char *setting) rc = 0; if (close_stream(fp) != 0) xwarn(_("setting key \"%s\""), outname); - if (rc == 0 && !Quiet) { + else if (rc == 0 && !Quiet) { if (NameOnly) { fprintf(stdout, "%s\n", outname); } else {