=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/head/head.c,v retrieving revision 1.12 retrieving revision 1.13 diff -c -r1.12 -r1.13 *** src/usr.bin/head/head.c 2006/10/06 23:44:30 1.12 --- src/usr.bin/head/head.c 2006/10/09 00:24:36 1.13 *************** *** 1,4 **** ! /* $OpenBSD: head.c,v 1.12 2006/10/06 23:44:30 ray Exp $ */ /* * Copyright (c) 1980, 1987 Regents of the University of California. --- 1,4 ---- ! /* $OpenBSD: head.c,v 1.13 2006/10/09 00:24:36 tedu Exp $ */ /* * Copyright (c) 1980, 1987 Regents of the University of California. *************** *** 30,43 **** */ #ifndef lint ! char copyright[] = "@(#) Copyright (c) 1980, 1987 Regents of the University of California.\n\ All rights reserved.\n"; - #endif /* not lint */ - - #ifndef lint /*static char sccsid[] = "from: @(#)head.c 5.5 (Berkeley) 6/1/90";*/ ! static char rcsid[] = "$OpenBSD: head.c,v 1.12 2006/10/06 23:44:30 ray Exp $"; #endif /* not lint */ #include --- 30,40 ---- */ #ifndef lint ! static const char copyright[] = "@(#) Copyright (c) 1980, 1987 Regents of the University of California.\n\ All rights reserved.\n"; /*static char sccsid[] = "from: @(#)head.c 5.5 (Berkeley) 6/1/90";*/ ! static const char rcsid[] = "$OpenBSD: head.c,v 1.13 2006/10/09 00:24:36 tedu Exp $"; #endif /* not lint */ #include *************** *** 67,76 **** /* handle obsolete -number syntax */ if (argc > 1 && argv[1][0] == '-' && isdigit(argv[1][1])) { p = argv[1] + 1; ! argc--; argv++; } ! while ((ch = getopt (argc, argv, "n:")) != -1) switch (ch) { case 'n': p = optarg; --- 64,74 ---- /* handle obsolete -number syntax */ if (argc > 1 && argv[1][0] == '-' && isdigit(argv[1][1])) { p = argv[1] + 1; ! argc--; ! argv++; } ! while ((ch = getopt(argc, argv, "n:")) != -1) { switch (ch) { case 'n': p = optarg; *************** *** 78,83 **** --- 76,82 ---- default: usage(); } + } argc -= optind, argv += optind; if (p) { *************** *** 93,100 **** if (!*argv) { if (!firsttime) exit(0); ! } ! else { if (!freopen(*argv, "r", stdin)) { warn("%s", *argv++); continue; --- 92,98 ---- if (!*argv) { if (!firsttime) exit(0); ! } else { if (!freopen(*argv, "r", stdin)) { warn("%s", *argv++); continue; *************** *** 121,124 **** fputs("usage: head [-n line_count] [file ...]\n", stderr); exit(1); } - --- 119,121 ----