Bug 116559 - make case statement of Bourne shell IEEE 1003.2-conformant
Summary: make case statement of Bourne shell IEEE 1003.2-conformant
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 7.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: Stefan Farfeleder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-22 19:20 UTC by Eygene Ryabinkin
Modified: 2007-10-26 11:26 UTC (History)
0 users

See Also:


Attachments
sh.patch (2.16 KB, patch)
2007-09-22 19:20 UTC, Eygene Ryabinkin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eygene Ryabinkin 2007-09-22 19:20:02 UTC
IEEE 1003.2 specifies that the return value of the 'case' construct
that did not matched any patterns shall be zero.  It is not the
case for the current FreeBSD /bin/sh.

Fix: The following patch will correct and document the expected behaviour.
How-To-Repeat: 
Run the test script that is embedded into the patch comments.
Comment 1 Stefan Farfeleder freebsd_committer freebsd_triage 2007-09-29 07:51:00 UTC
Responsible Changed
From-To: freebsd-bugs->stefanf

Grab.
Comment 2 dfilter service freebsd_committer freebsd_triage 2007-10-04 17:15:01 UTC
stefanf     2007-10-04 16:14:49 UTC

  FreeBSD src repository

  Modified files:
    bin/sh               eval.c sh.1 
  Added files:
    tools/regression/bin/sh/builtins case1.0 
  Log:
  The exit status of a case statement where none of the patterns is matched
  is supposed to be 0, not the status of the previous command.
  
  Reported by:    Eygene Ryabinkin
  PR:             116559
  Approved by:    re (gnn)
  
  Revision  Changes    Path
  1.54      +1 -0      src/bin/sh/eval.c
  1.125     +4 -0      src/bin/sh/sh.1
  1.1       +13 -0     src/tools/regression/bin/sh/builtins/case1.0 (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 3 Stefan Farfeleder freebsd_committer freebsd_triage 2007-10-04 17:17:23 UTC
State Changed
From-To: open->patched

Fixed in current.
Comment 4 Stefan Farfeleder freebsd_committer freebsd_triage 2007-10-26 11:26:14 UTC
State Changed
From-To: patched->closed

Also merged to RELENG_6.  Thanks!