csplit.c (be27b3116288a0ff98ddce9c853b6f4fe55e85ee) csplit.c (48b644192d73be11d54b4b3dcfe255bd1b47884d)
1/*-
2 * Copyright (c) 2002 Tim J. Robbins.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 385 unchanged lines hidden (view full) ---

394 while ((p = get_line()) != NULL) {
395 if (fputs(p, ofp) == EOF)
396 break;
397 if (!first && regexec(&cre, p, 0, NULL, 0) == 0)
398 break;
399 first = 0;
400 }
401
1/*-
2 * Copyright (c) 2002 Tim J. Robbins.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 385 unchanged lines hidden (view full) ---

394 while ((p = get_line()) != NULL) {
395 if (fputs(p, ofp) == EOF)
396 break;
397 if (!first && regexec(&cre, p, 0, NULL, 0) == 0)
398 break;
399 first = 0;
400 }
401
402 if (p == NULL)
402 if (p == NULL) {
403 toomuch(NULL, 0);
403 errx(1, "%s: no match", re);
404 errx(1, "%s: no match", re);
405 }
404
405 if (ofs <= 0) {
406 /*
407 * Negative (or zero) offset: throw back any lines we should
408 * not have read yet.
409 */
410 if (p != NULL) {
411 toomuch(ofp, -ofs + 1);

--- 56 unchanged lines hidden ---
406
407 if (ofs <= 0) {
408 /*
409 * Negative (or zero) offset: throw back any lines we should
410 * not have read yet.
411 */
412 if (p != NULL) {
413 toomuch(ofp, -ofs + 1);

--- 56 unchanged lines hidden ---