Bug 193994 - sort doesn't handle old key notation properly
Summary: sort doesn't handle old key notation properly
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: Normal Affects Many People
Assignee: Baptiste Daroussin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-28 13:07 UTC by Rodrigo Osorio
Modified: 2014-10-06 12:08 UTC (History)
1 user (show)

See Also:


Attachments
patch for head (314 bytes, patch)
2014-09-28 13:07 UTC, Rodrigo Osorio
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rodrigo Osorio freebsd_committer 2014-09-28 13:07:41 UTC
Created attachment 147749 [details]
patch for head

The bsd sort doesn't handle properly old notation for keys,and in some cases the conversion function skips last argument.

'sort +0n' is converted in 'sort -k1,1' loosing the ability to perform a numeric sort.
Comment 1 commit-hook freebsd_committer 2014-10-02 06:30:28 UTC
A commit references this bug:

Author: bapt
Date: Thu Oct  2 06:29:49 UTC 2014
New revision: 272398
URL: https://svnweb.freebsd.org/changeset/base/272398

Log:
  Make sure to not skip any argument when converting from deprecated
  +POS1, -POS2 to -kPOS1,POS2, so that sort +0n gets translated to sort -k1,1n
  as it is expected

  PR:		193994
  Submitted by:	rodrigo
  MFC after:	3 days

Changes:
  head/usr.bin/sort/sort.c
Comment 2 commit-hook freebsd_committer 2014-10-06 09:15:34 UTC
A commit references this bug:

Author: bapt
Date: Mon Oct  6 09:15:10 UTC 2014
New revision: 272603
URL: https://svnweb.freebsd.org/changeset/base/272603

Log:
  MFC: r272398

  Make sure to not skip any argument when converting from deprecated
  +POS1, -POS2 to -kPOS1,POS2, so that sort +0n gets translated to sort -k1,1n
  as it is expected

  PR:		193994
  Submitted by:	rodrigo
  MFC after:	3 days

Changes:
_U  stable/10/
  stable/10/usr.bin/sort/sort.c
Comment 3 commit-hook freebsd_committer 2014-10-06 12:08:52 UTC
A commit references this bug:

Author: bapt
Date: Mon Oct  6 12:08:15 UTC 2014
New revision: 272611
URL: https://svnweb.freebsd.org/changeset/base/272611

Log:
  MFC: r272398

  Make sure to not skip any argument when converting from deprecated
  +POS1, -POS2 to -kPOS1,POS2, so that sort +0n gets translated to sort -k1,1n
  as it is expected

  PR:		193994
  Submitted by:	rodrigo
  Approved by:	re (marius)

Changes:
_U  releng/10.1/
  releng/10.1/usr.bin/sort/sort.c