1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

r20179: Sync up with Samba4 - remove blank lines at the

end parsing a file.
Jeremy.
(This used to be commit ea8215935e)
This commit is contained in:
Jeremy Allison 2006-12-15 01:50:04 +00:00 committed by Gerald (Jerry) Carter
parent d29722e378
commit 728bee7ff3

View File

@ -285,9 +285,6 @@ static char **file_lines_parse(char *p, size_t size, int *numlines)
return NULL;
}
memset(ret, 0, sizeof(ret[0])*(i+2));
if (numlines) {
*numlines = i;
}
ret[0] = p;
for (s = p, i=0; s < p+size; s++) {
@ -301,6 +298,15 @@ static char **file_lines_parse(char *p, size_t size, int *numlines)
}
}
/* remove any blank lines at the end */
while (i > 0 && ret[i-1][0] == 0) {
i--;
}
if (numlines) {
*numlines = i;
}
return ret;
}