[RFC] Make /bin/sh's case construct POSIX-2 conformant

Eygene Ryabinkin rea-fbsd at codelabs.ru
Mon Sep 24 03:32:50 PDT 2007


Good day.

Basically all that I will say here (and more) is said in bin/116559,
  http://www.freebsd.org/cgi/query-pr.cgi?pr=116559

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 now, as shown by the simple test:
-----
#!/bin/sh

false
case test in
Test)
	;;
esac && echo ok
-----
Now the case that has no patterns matched does not touch the exit
value at all.  PR has the patch that fixes the issue.

Any comments on it?  Maybe someone will be so kind to test this
patch on his system(s)?  Mine are showing no troubles yet ;))

Thank you!
-- 
Eygene


More information about the freebsd-current mailing list