- /* Now convert the output to a list of lines. */
- p = out;
- while (p) {
- pend = strchr (p, '\n');
- if (pend) {
- *pend = '\0';
- pend++;
-
- /* Final \n? Don't return an empty final element. */
- if (*pend == '\0') break;
- }
-
- if (add_string (&lines, &size, &alloc, p) == -1) {
- free (out);
- return NULL;
- }
-
- p = pend;
- }
-