summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sort.c13
-rw-r--r--src/tail.c4
2 files changed, 9 insertions, 8 deletions
diff --git a/src/sort.c b/src/sort.c
index 9d1b8ac35..5b75ebe45 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -852,24 +852,25 @@ limfield (const struct line *line, const struct keyfield *key)
From: kwzh@gnu.ai.mit.edu (Karl Heuer)
Date: Thu, 30 May 96 12:20:41 -0400
+ [Translated to POSIX 1003.1-2001 terminology by Paul Eggert.]
[...]I believe I've found another bug in `sort'.
$ cat /tmp/sort.in
a b c 2 d
pq rs 1 t
- $ textutils-1.15/src/sort +0.6 -0.7 </tmp/sort.in
+ $ textutils-1.15/src/sort -k1.7,1.7 </tmp/sort.in
a b c 2 d
pq rs 1 t
- $ /bin/sort +0.6 -0.7 </tmp/sort.in
+ $ /bin/sort -k1.7,1.7 </tmp/sort.in
pq rs 1 t
a b c 2 d
Unix sort produced the answer I expected: sort on the single character
- in column 6. GNU sort produced different results, because it disagrees
- on the interpretation of the key-end spec "-M.N". Unix sort reads this
- as "skip M fields, then N characters"; but GNU sort wants it to mean
- "skip M fields, then either N characters or the rest of the current
+ in column 7. GNU sort produced different results, because it disagrees
+ on the interpretation of the key-end spec "M.N". Unix sort reads this
+ as "skip M-1 fields, then N-1 characters"; but GNU sort wants it to mean
+ "skip M-1 fields, then either N-1 characters or the rest of the current
field, whichever comes first". This extra clause applies only to
key-ends, not key-starts.
*/
diff --git a/src/tail.c b/src/tail.c
index 3ab262d03..c6203b1b9 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -1615,8 +1615,8 @@ main (int argc, char **argv)
}
/* To start printing with item N_UNITS from the start of the file, skip
- N_UNITS - 1 items. `tail +0' is actually meaningless, but for Unix
- compatibility it's treated the same as `tail +1'. */
+ N_UNITS - 1 items. `tail -n +0' is actually meaningless, but for Unix
+ compatibility it's treated the same as `tail -n +1'. */
if (from_start)
{
if (n_units)