Magellan Linux

Contents of /trunk/coreutils/patches-5.3.0/coreutils-5.3.0-warning-tail.c.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 44 - (show annotations) (download)
Thu Oct 13 21:17:16 2005 UTC (18 years, 7 months ago) by niro
File size: 1345 byte(s)
patch set for coretutils-5.3.0

1 diff -urN 1/src/tail.c 2/src/tail.c
2 --- 1/src/tail.c 2005-03-25 23:51:05.000000000 +0000
3 +++ 2/src/tail.c 2005-03-30 14:20:21.000000000 +0000
4 @@ -1375,7 +1375,7 @@
5 const char *p = argv[1];
6 const char *n_string;
7 const char *n_string_end;
8 - bool obsolete_usage;
9 + bool obsolete_usage, obsolete_usage_posixly_correct;
10 int default_count = DEFAULT_N_LINES;
11 bool t_from_start;
12 bool t_count_lines = true;
13 @@ -1387,7 +1387,8 @@
14 if (argc < 2)
15 return false;
16
17 - obsolete_usage = (posix2_version () < 200112) || !getenv ("POSIXLY_CORRECT");
18 + obsolete_usage = (posix2_version () < 200112);
19 + obsolete_usage_posixly_correct = !getenv ("POSIXLY_CORRECT");
20
21 switch (*p++)
22 {
23 @@ -1395,10 +1396,6 @@
24 return false;
25
26 case '+':
27 - /* Leading "+" is a file name in the non-obsolete form. */
28 - if (!obsolete_usage)
29 - return false;
30 -
31 t_from_start = true;
32 break;
33
34 @@ -1446,10 +1443,11 @@
35
36 if (!obsolete_usage)
37 {
38 - error (0, 0, _("`%s' option is obsolete; use `%s-%c %"PRIuMAX"'"),
39 + error (0, 0, _("`%s' option is obsolete; use `%s-%c %"PRIuMAX"' since this will be removed in the future"),
40 argv[1], t_forever ? "-f " : "", t_count_lines ? 'n' : 'c',
41 *n_units);
42 - usage (EXIT_FAILURE);
43 + if (!obsolete_usage_posixly_correct)
44 + usage (EXIT_FAILURE);
45 }
46 }
47