File procps-ng-3.3.9-sysctl-a.patch of Package procps.8447
--- sysctl.c
+++ sysctl.c 2017-05-22 08:21:25.845040233 +0000
@@ -246,14 +246,20 @@ static int ReadSetting(const char *restr
} else {
/* already has the \n in it */
if (PrintName) {
- fprintf(stdout, "%s = %s",
- outname, inbuf);
- if (inbuf[strlen(inbuf) - 1] != '\n')
+ int nl = 0;
+ fprintf(stdout, "%s = ", outname);
+ do {
+ fprintf(stdout, "%s", inbuf);
+ if (inbuf[strlen(inbuf) - 1] == '\n') {
+ nl++;
+ break;
+ }
+ } while (fgets(inbuf, sizeof inbuf - 1, fp));
+ if (!nl)
putchar('\n');
} else {
if (!PrintNewline) {
- char *nlptr =
- strchr(inbuf, '\n');
+ char *nlptr = strchr(inbuf, '\n');
if (nlptr)
*nlptr = '\0';
}