]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Fix so that `tail -fn 2 file' works again.
authorJim Meyering <jim@meyering.net>
Wed, 3 Nov 1999 13:06:50 +0000 (13:06 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 3 Nov 1999 13:06:50 +0000 (13:06 +0000)
(anonymous enum) [LONG_FOLLOW_OPTION]: Define.
(long_options): Use LONG_FOLLOW_OPTION here, instead of 'f'.
(main): Remove the `::' after the `f' in getopt_long string.
Add `case LONG_FOLLOW_OPTION' after `case 'f':'.
Based on a patch from Tim Waugh.

src/tail.c

index 48cefde056df34726f31f6f27a84e8294531a2e0..8179f5c8b942c4401c8be053de9788cf84526607 100644 (file)
@@ -194,6 +194,7 @@ enum
   MAX_UNCHANGED_STATS_OPTION,
   MAX_CONSECUTIVE_SIZE_CHANGES_OPTION,
   PID_OPTION,
+  LONG_FOLLOW_OPTION,
 };
 
 static struct option const long_options[] =
@@ -202,7 +203,7 @@ static struct option const long_options[] =
      FIXME: remove it some day */
   {"allow-missing", no_argument, NULL, RETRY_OPTION},
   {"bytes", required_argument, NULL, 'c'},
-  {"follow", optional_argument, NULL, 'f'},
+  {"follow", optional_argument, NULL, LONG_FOLLOW_OPTION},
   {"lines", required_argument, NULL, 'n'},
   {"max-unchanged-stats", required_argument, NULL, MAX_UNCHANGED_STATS_OPTION},
   {"max-consecutive-size-changes", required_argument, NULL,
@@ -1312,7 +1313,7 @@ parse_options (int argc, char **argv,
   count_lines = 1;
   forever = from_start = print_headers = 0;
 
-  while ((c = getopt_long (argc, argv, "c:n:f::qs:v", long_options, NULL))
+  while ((c = getopt_long (argc, argv, "c:n:fqs:v", long_options, NULL))
         != -1)
     {
       switch (c)
@@ -1351,6 +1352,7 @@ parse_options (int argc, char **argv,
          break;
 
        case 'f':
+       case LONG_FOLLOW_OPTION:
          forever = 1;
          if (optarg == NULL)
            follow_mode = DEFAULT_FOLLOW_MODE;