Annotation of /trunk/coreutils/patches-5.3.0/coreutils-5.3.0-allow-old-options.patch
Parent Directory | Revision Log
Revision 44 -
(hide annotations)
(download)
Thu Oct 13 21:17:16 2005 UTC (18 years, 11 months ago) by niro
File size: 5991 byte(s)
Thu Oct 13 21:17:16 2005 UTC (18 years, 11 months ago) by niro
File size: 5991 byte(s)
patch set for coretutils-5.3.0
1 | niro | 44 | --- ./src/date.c.old-options 2003-12-10 17:31:54.000000000 +0100 |
2 | +++ ./src/date.c 2003-12-10 17:31:54.000000000 +0100 | ||
3 | @@ -300,7 +300,8 @@ | ||
4 | int n_args; | ||
5 | int status; | ||
6 | int option_specified_date; | ||
7 | - char const *short_options = (posix2_version () < 200112 | ||
8 | + char const *short_options = (posix2_version () < 200112 || | ||
9 | + !getenv ("POSIXLY_CORRECT") | ||
10 | ? COMMON_SHORT_OPTIONS "I::" | ||
11 | : COMMON_SHORT_OPTIONS "I:"); | ||
12 | |||
13 | --- ./src/expand.c.old-options 2003-12-10 17:31:54.000000000 +0100 | ||
14 | +++ ./src/expand.c 2003-12-10 17:31:54.000000000 +0100 | ||
15 | @@ -567,7 +567,8 @@ | ||
16 | } | ||
17 | } | ||
18 | |||
19 | - if (obsolete_tablist && 200112 <= posix2_version ()) | ||
20 | + if (obsolete_tablist && 200112 <= posix2_version () && | ||
21 | + getenv ("POSIXLY_CORRECT")) | ||
22 | { | ||
23 | error (0, 0, _("`-LIST' option is obsolete; use `-t LIST'")); | ||
24 | usage (EXIT_FAILURE); | ||
25 | --- ./src/fold.c.old-options 2003-12-10 17:31:54.000000000 +0100 | ||
26 | +++ ./src/fold.c 2003-12-10 17:31:54.000000000 +0100 | ||
27 | @@ -540,7 +540,7 @@ | ||
28 | s[1] = 'w'; | ||
29 | strcpy (s + 2, a + 1); | ||
30 | argv[i] = s; | ||
31 | - if (200112 <= posix2_version ()) | ||
32 | + if (200112 <= posix2_version () && getenv ("POSIXLY_CORRECT")) | ||
33 | { | ||
34 | error (0, 0, _("`%s' option is obsolete; use `%s'"), a, s); | ||
35 | usage (EXIT_FAILURE); | ||
36 | --- ./src/head.c.old-options 2003-09-05 21:12:10.000000000 +0200 | ||
37 | +++ ./src/head.c 2003-12-10 17:31:54.000000000 +0100 | ||
38 | @@ -995,7 +995,7 @@ | ||
39 | } | ||
40 | } | ||
41 | |||
42 | - if (200112 <= posix2_version ()) | ||
43 | + if (200112 <= posix2_version () && getenv ("POSIXLY_CORRECT")) | ||
44 | { | ||
45 | error (0, 0, _("`-%s' option is obsolete; use `-%c %.*s%.*s%s'"), | ||
46 | n_string, count_lines ? 'n' : 'c', | ||
47 | --- ./src/nice.c.old-options 2003-08-10 19:43:35.000000000 +0200 | ||
48 | +++ ./src/nice.c 2003-12-10 17:31:54.000000000 +0100 | ||
49 | @@ -106,7 +106,7 @@ | ||
50 | char *s = argv[i]; | ||
51 | |||
52 | if (s[0] == '-' && ISDIGIT (s[1 + (s[1] == '-' || s[1] == '+')]) | ||
53 | - && posix2_version () < 200112) | ||
54 | + && (posix2_version () < 200112 || !getenv ("POSIXLY_CORRECT"))) | ||
55 | { | ||
56 | adjustment_given = s + 1; | ||
57 | ++i; | ||
58 | --- ./src/od.c.old-options 2003-07-23 09:26:48.000000000 +0200 | ||
59 | +++ ./src/od.c 2003-12-10 17:31:54.000000000 +0100 | ||
60 | @@ -1617,7 +1617,8 @@ | ||
61 | bool modern = false; | ||
62 | bool width_specified = false; | ||
63 | bool ok = true; | ||
64 | - char const *short_options = (posix2_version () < 200112 | ||
65 | + char const *short_options = (posix2_version () < 200112 || | ||
66 | + !getenv ("POSIXLY_CORRECT") | ||
67 | ? COMMON_SHORT_OPTIONS "w::" | ||
68 | : COMMON_SHORT_OPTIONS "w:"); | ||
69 | |||
70 | --- ./src/pr.c.old-options 2003-12-10 17:31:54.000000000 +0100 | ||
71 | +++ ./src/pr.c 2003-12-10 17:31:54.000000000 +0100 | ||
72 | @@ -890,7 +890,8 @@ | ||
73 | int old_w = FALSE; | ||
74 | int old_s = FALSE; | ||
75 | char **file_names; | ||
76 | - char const *short_options = (posix2_version () < 200112 | ||
77 | + char const *short_options = (posix2_version () < 200112 || | ||
78 | + !getenv ("POSIXLY_CORRECT") | ||
79 | ? COMMON_SHORT_OPTIONS "S::" | ||
80 | : COMMON_SHORT_OPTIONS "S:"); | ||
81 | |||
82 | --- ./src/sort.c.old-options 2003-12-10 17:31:54.000000000 +0100 | ||
83 | +++ ./src/sort.c 2003-12-10 17:32:31.000000000 +0100 | ||
84 | @@ -2867,7 +2867,7 @@ | ||
85 | bool mergeonly = false; | ||
86 | int nfiles = 0; | ||
87 | bool posixly_correct = (getenv ("POSIXLY_CORRECT") != NULL); | ||
88 | - bool obsolete_usage = (posix2_version () < 200112); | ||
89 | + bool obsolete_usage = (posix2_version () < 200112) || !posixly_correct; | ||
90 | char const *short_options = (obsolete_usage | ||
91 | ? COMMON_SHORT_OPTIONS "y::" | ||
92 | : COMMON_SHORT_OPTIONS "y:"); | ||
93 | --- ./src/split.c.old-options 2003-08-09 11:30:53.000000000 +0200 | ||
94 | +++ ./src/split.c 2003-12-10 17:31:54.000000000 +0100 | ||
95 | @@ -497,7 +497,8 @@ | ||
96 | } | ||
97 | } | ||
98 | |||
99 | - if (digits_optind && 200112 <= posix2_version ()) | ||
100 | + if (digits_optind && 200112 <= posix2_version () | ||
101 | + && getenv ("POSIXLY_CORRECT")) | ||
102 | { | ||
103 | char buffer[INT_BUFSIZE_BOUND (uintmax_t)]; | ||
104 | char const *a = umaxtostr (n_units, buffer); | ||
105 | --- ./src/tail.c.old-options 2003-09-06 10:47:00.000000000 +0200 | ||
106 | +++ ./src/tail.c 2003-12-10 17:31:54.000000000 +0100 | ||
107 | @@ -1363,7 +1363,7 @@ | ||
108 | if (argc < 2) | ||
109 | return 0; | ||
110 | |||
111 | - obsolete_usage = (posix2_version () < 200112); | ||
112 | + obsolete_usage = (posix2_version () < 200112) || !getenv ("POSIXLY_CORRECT"); | ||
113 | |||
114 | /* If P starts with `+' and the POSIX version predates 1003.1-2001, | ||
115 | or if P starts with `-N' (where N is a digit), or `-l', then it | ||
116 | --- ./src/touch.c.old-options 2003-12-10 17:31:54.000000000 +0100 | ||
117 | +++ ./src/touch.c 2003-12-10 17:31:54.000000000 +0100 | ||
118 | @@ -389,7 +389,8 @@ | ||
119 | |||
120 | /* The obsolete `MMDDhhmm[YY]' form is valid IFF there are | ||
121 | two or more non-option arguments. */ | ||
122 | - if (!date_set && 2 <= argc - optind && posix2_version () < 200112 | ||
123 | + if (!date_set && 2 <= argc - optind | ||
124 | + && (posix2_version () < 200112 || !getenv ("POSIXLY_CORRECT")) | ||
125 | && posixtime (&newtime[0].tv_sec, argv[optind], PDS_TRAILING_YEAR)) | ||
126 | { | ||
127 | newtime[0].tv_nsec = 0; | ||
128 | --- ./src/unexpand.c.old-options 2003-12-10 17:31:54.000000000 +0100 | ||
129 | +++ ./src/unexpand.c 2003-12-10 17:31:54.000000000 +0100 | ||
130 | @@ -677,7 +677,8 @@ | ||
131 | } | ||
132 | } | ||
133 | |||
134 | - if (obsolete_tablist && 200112 <= posix2_version ()) | ||
135 | + if (obsolete_tablist && 200112 <= posix2_version () | ||
136 | + && getenv ("POSIXLY_CORRECT")) | ||
137 | { | ||
138 | error (0, 0, | ||
139 | _("`-LIST' option is obsolete; use `--first-only -t LIST'")); | ||
140 | --- ./src/uniq.c.old-options 2003-12-10 17:31:54.000000000 +0100 | ||
141 | +++ ./src/uniq.c 2003-12-10 17:31:54.000000000 +0100 | ||
142 | @@ -684,7 +684,7 @@ | ||
143 | { | ||
144 | unsigned long int size; | ||
145 | if (optarg[0] == '+' | ||
146 | - && posix2_version () < 200112 | ||
147 | + && (posix2_version () < 200112 || !getenv ("POSIXLY_CORRECT")) | ||
148 | && xstrtoul (optarg, NULL, 10, &size, "") == LONGINT_OK | ||
149 | && size <= SIZE_MAX) | ||
150 | skip_chars = size; | ||
151 | @@ -769,7 +769,8 @@ | ||
152 | } | ||
153 | } | ||
154 | |||
155 | - if (obsolete_skip_fields && 200112 <= posix2_version ()) | ||
156 | + if (obsolete_skip_fields && 200112 <= posix2_version () | ||
157 | + && getenv ("POSIXLY_CORRECT")) | ||
158 | { | ||
159 | error (0, 0, _("`-%lu' option is obsolete; use `-f %lu'"), | ||
160 | (unsigned long) skip_fields, (unsigned long) skip_fields); |