+ }
+ else {
+ for (ptr = line; (ptr = strchr(ptr, delim)) != NULL; ptr++) {
+ delims_hit++;
+ if (delims_hit == (startpos - 1)) {
+ start = ptr+1;
+ }
+ if (delims_hit == endpos) {
+ break;
+ }
+ }
+
+ /* we didn't hit any delimeters */
+ if (delims_hit == 0 && !supress_non_delimited_lines) {
+ fputs(line, stdout);
+ }
+ /* we =did= hit some delimiters */
+ else if (delims_hit > 0) {
+ /* we have a fixed end point */
+ if (ptr) {
+ while (start < ptr) {
+ fputc(*start, stdout);
+ start++;
+ }
+ fputc('\n', stdout);
+ }
+ /* or we're just going til the end of the line */
+ else {
+ while (*start) {
+ fputc(*start, stdout);
+ start++;
+ }