[BACK]Return to head.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / head

Diff for /src/usr.bin/head/head.c between version 1.12 and 1.13

version 1.12, 2006/10/06 23:44:30 version 1.13, 2006/10/09 00:24:36
Line 30 
Line 30 
  */   */
   
 #ifndef lint  #ifndef lint
 char copyright[] =  static const char copyright[] =
 "@(#) Copyright (c) 1980, 1987 Regents of the University of California.\n\  "@(#) Copyright (c) 1980, 1987 Regents of the University of California.\n\
  All rights reserved.\n";   All rights reserved.\n";
 #endif /* not lint */  
   
 #ifndef lint  
 /*static char sccsid[] = "from: @(#)head.c      5.5 (Berkeley) 6/1/90";*/  /*static char sccsid[] = "from: @(#)head.c      5.5 (Berkeley) 6/1/90";*/
 static char rcsid[] = "$OpenBSD$";  static const char rcsid[] = "$OpenBSD$";
 #endif /* not lint */  #endif /* not lint */
   
 #include <stdio.h>  #include <stdio.h>
Line 67 
Line 64 
         /* handle obsolete -number syntax */          /* handle obsolete -number syntax */
         if (argc > 1 && argv[1][0] == '-' && isdigit(argv[1][1])) {          if (argc > 1 && argv[1][0] == '-' && isdigit(argv[1][1])) {
                 p = argv[1] + 1;                  p = argv[1] + 1;
                 argc--; argv++;                  argc--;
                   argv++;
         }          }
   
         while ((ch = getopt (argc, argv, "n:")) != -1)          while ((ch = getopt(argc, argv, "n:")) != -1) {
                 switch (ch) {                  switch (ch) {
                 case 'n':                  case 'n':
                         p = optarg;                          p = optarg;
Line 78 
Line 76 
                 default:                  default:
                         usage();                          usage();
                 }                  }
           }
         argc -= optind, argv += optind;          argc -= optind, argv += optind;
   
         if (p) {          if (p) {
Line 93 
Line 92 
                 if (!*argv) {                  if (!*argv) {
                         if (!firsttime)                          if (!firsttime)
                                 exit(0);                                  exit(0);
                 }                  } else {
                 else {  
                         if (!freopen(*argv, "r", stdin)) {                          if (!freopen(*argv, "r", stdin)) {
                                 warn("%s", *argv++);                                  warn("%s", *argv++);
                                 continue;                                  continue;
Line 121 
Line 119 
         fputs("usage: head [-n line_count] [file ...]\n", stderr);          fputs("usage: head [-n line_count] [file ...]\n", stderr);
         exit(1);          exit(1);
 }  }
   

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13