Deleted Added
full compact
tail.c (92922) tail.c (99983)
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Edward Sze-Tyan Wang.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 */
36
37#include <sys/cdefs.h>
38
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Edward Sze-Tyan Wang.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 */
36
37#include <sys/cdefs.h>
38
39__FBSDID("$FreeBSD: head/usr.bin/tail/tail.c 92922 2002-03-22 01:42:45Z imp $");
39__FBSDID("$FreeBSD: head/usr.bin/tail/tail.c 99983 2002-07-14 18:21:07Z alfred $");
40
41#ifndef lint
42static const char copyright[] =
43"@(#) Copyright (c) 1991, 1993\n\
44 The Regents of the University of California. All rights reserved.\n";
45#endif
46
47#ifndef lint

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

62
63int Fflag, fflag, rflag, rval;
64const char *fname;
65
66static void obsolete(char **);
67static void usage(void);
68
69int
40
41#ifndef lint
42static const char copyright[] =
43"@(#) Copyright (c) 1991, 1993\n\
44 The Regents of the University of California. All rights reserved.\n";
45#endif
46
47#ifndef lint

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

62
63int Fflag, fflag, rflag, rval;
64const char *fname;
65
66static void obsolete(char **);
67static void usage(void);
68
69int
70main(argc, argv)
71 int argc;
72 char *argv[];
70main(int argc, char *argv[])
73{
74 struct stat sb;
75 FILE *fp;
76 off_t off;
77 enum STYLE style;
78 int ch, first;
79 char *p;
80

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

217}
218
219/*
220 * Convert the obsolete argument form into something that getopt can handle.
221 * This means that anything of the form [+-][0-9][0-9]*[lbc][Ffr] that isn't
222 * the option argument for a -b, -c or -n option gets converted.
223 */
224static void
71{
72 struct stat sb;
73 FILE *fp;
74 off_t off;
75 enum STYLE style;
76 int ch, first;
77 char *p;
78

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

215}
216
217/*
218 * Convert the obsolete argument form into something that getopt can handle.
219 * This means that anything of the form [+-][0-9][0-9]*[lbc][Ffr] that isn't
220 * the option argument for a -b, -c or -n option gets converted.
221 */
222static void
225obsolete(argv)
226 char *argv[];
223obsolete(char *argv[])
227{
228 char *ap, *p, *t;
229 size_t len;
230 char *start;
231
232 while ((ap = *++argv)) {
233 /* Return if "--" or not an option of any form. */
234 if (ap[0] != '-') {

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

301 /* Illegal option, return and let getopt handle it. */
302 default:
303 return;
304 }
305 }
306}
307
308static void
224{
225 char *ap, *p, *t;
226 size_t len;
227 char *start;
228
229 while ((ap = *++argv)) {
230 /* Return if "--" or not an option of any form. */
231 if (ap[0] != '-') {

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

298 /* Illegal option, return and let getopt handle it. */
299 default:
300 return;
301 }
302 }
303}
304
305static void
309usage()
306usage(void)
310{
311 (void)fprintf(stderr,
312 "usage: tail [-F | -f | -r] [-b # | -c # | -n #] [file ...]\n");
313 exit(1);
314}
307{
308 (void)fprintf(stderr,
309 "usage: tail [-F | -f | -r] [-b # | -c # | -n #] [file ...]\n");
310 exit(1);
311}