HomeFreeBSD

newvers.sh: Don't use return to exit.

Description

newvers.sh: Don't use return to exit.

Commit acfb506b3d00 replaced an exit 0 when using -V with a return
instead. FreeBSD's sh treats a return outside of a function like
exit, but this is a non-portable extension. Other Bourne shells only
permit return to be used within a function and continue execution
(possibly with a warning).

To fix, don't reuse VARS_ONLY (which is intended to be set by other
scripts before sourcing newvers.sh directly) and instead use a new
variable (VARS_ONLY_EXIT) to restore the use of exit for the
non-sourced case.

Reviewed by: emaste
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D35481

(cherry picked from commit 6ab35c78fb5af66d586d4846e2d81e020331ad3f)

Details

Provenance
jhbAuthored on Jun 14 2022, 5:51 PM
Reviewer
emaste
Differential Revision
D35481: newvers.sh: Don't use return to exit.
Parents
rGb45594b2713a: firmware: Map '@' in filenames to '_' in symbols.
Branches
Unknown
Tags
Unknown