Deleted Added
sdiff udiff text old ( 92920 ) new ( 100817 )
full compact
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. 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

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

39
40#if 0
41#ifndef lint
42static char sccsid[] = "@(#)colrm.c 8.2 (Berkeley) 5/4/95";
43#endif
44#endif
45
46#include <sys/cdefs.h>
47__FBSDID("$FreeBSD: head/usr.bin/colrm/colrm.c 100817 2002-07-28 15:22:43Z dwmalone $");
48
49#include <sys/types.h>
50#include <err.h>
51#include <errno.h>
52#include <limits.h>
53#include <stdio.h>
54#include <stdlib.h>
55#include <string.h>
56#include <unistd.h>
57
58#define TAB 8
59
60void check(FILE *);
61static void usage(void);
62
63int
64main(int argc, char *argv[])
65{
66 u_long column, start, stop;
67 int ch;
68 char *p;
69
70 while ((ch = getopt(argc, argv, "")) != -1)
71 switch(ch) {
72 case '?':

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

119
120 if ((!start || column < start || (stop && column > stop)) &&
121 putchar(ch) == EOF)
122 check(stdout);
123 }
124}
125
126void
127check(FILE *stream)
128{
129 if (feof(stream))
130 exit(0);
131 if (ferror(stream))
132 err(1, "%s", stream == stdin ? "stdin" : "stdout");
133}
134
135void
136usage(void)
137{
138 (void)fprintf(stderr, "usage: colrm [start [stop]]\n");
139 exit(1);
140}
141