Bug 193994

Summary: sort doesn't handle old key notation properly
Product: Base System Reporter: Rodrigo Osorio <rodrigo>
Component: binAssignee: Baptiste Daroussin <bapt>
Status: Closed FIXED    
Severity: Affects Many People CC: emaste
Priority: Normal    
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch for head none

Description Rodrigo Osorio freebsd_committer freebsd_triage 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 freebsd_triage 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 freebsd_triage 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 freebsd_triage 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