+ }
+ } else if (delim == '\n') { /* cut by lines */
+ spos = cut_lists[cl_pos].startpos;
+
+ /* get out if we have no more lists to process or if the lines
+ * are lower than what we're interested in */
+ if (((int)linenum < spos) || (cl_pos >= nlists))
+ goto next_line;
+
+ /* if the line we're looking for is lower than the one we were
+ * passed, it means we displayed it already, so move on */
+ while (spos < (int)linenum) {
+ spos++;
+ /* go to the next list if we're at the end of this one */
+ if (spos > cut_lists[cl_pos].endpos
+ || cut_lists[cl_pos].endpos == NON_RANGE
+ ) {
+ cl_pos++;
+ /* get out if there's no more lists to process */
+ if (cl_pos >= nlists)
+ goto next_line;
+ spos = cut_lists[cl_pos].startpos;
+ /* get out if the current line is lower than the one
+ * we just became interested in */
+ if ((int)linenum < spos)
+ goto next_line;