+ DPRINTF (("Pushing expansion: %s", cstring_copyLength (xbuf, xbuf_len)));
+
+ if (end_line != start_line)
+ {
+ /* xbuf must have enough newlines */
+ int newlines = end_line - start_line;
+ int foundnewlines = 0;
+ char *xbufptr = xbuf;
+
+ while ((xbufptr = strchr (xbufptr, '\n')) != NULL && foundnewlines <= newlines)
+ {
+ foundnewlines++;
+ xbufptr++;
+
+ if (*xbufptr == '\0')
+ {
+ break;
+ }
+ }
+
+ if (foundnewlines < newlines)
+ {
+ cstring newbuf = cstring_copyLength (xbuf, xbuf_len);
+
+ while (foundnewlines < newlines)
+ {
+ newbuf = cstring_appendChar (newbuf, '\n');
+ foundnewlines++;
+ }
+
+ sfree (oxbuf);
+ xbuf = cstring_toCharsSafe (newbuf);
+ xbuf_len = cstring_length (newbuf);
+ /*@-branchstate@*/
+ } /*@=branchstate@*/
+ }
+
+ DPRINTF (("Pushing expansion: %s", cstring_copyLength (xbuf, xbuf_len)));
+