freebsd-skq/bin/sh
jilles bc5702addf sh: Make getopts memory-safe if with changing arguments.
POSIX does not permit to continuing a getopts loop with different
arguments. For parsing the positional parameters, we handle this case by
resetting the getopts state when the positional parameters are changed in
any way (and the getopts state is local to a function). However, in the
syntax getopts <optstring> <var> <arg...>, changes could lead to invalid
memory access.

In the syntax getopts <optstring> <var> <arg...>, store a copy of the
arguments and continue to use them until getopts is reset.
2014-10-26 17:50:33 +00:00
..
bltin
funcs
tests sh: Make getopts memory-safe if with changing arguments. 2014-10-26 17:50:33 +00:00
alias.c
alias.h
arith_yacc.c
arith_yacc.h
arith_yylex.c
arith.h
builtins.def
cd.c
cd.h
error.c
error.h
eval.c sh: Make getopts memory-safe if with changing arguments. 2014-10-26 17:50:33 +00:00
eval.h
exec.c
exec.h
expand.c sh: Remove more gotos. 2014-10-15 21:20:56 +00:00
expand.h
histedit.c
input.c sh: Remove arbitrary length limit on << EOF markers. 2014-09-14 16:46:30 +00:00
input.h sh: Remove arbitrary length limit on << EOF markers. 2014-09-14 16:46:30 +00:00
jobs.c sh: Remove more gotos. 2014-10-15 21:20:56 +00:00
jobs.h
mail.c
mail.h
main.c
main.h
Makefile
memalloc.c
memalloc.h
miscbltin.c
mkbuiltins
mknodes.c
mksyntax.c
mktokens
myhistedit.h
mystring.c
mystring.h
nodes.c.pat
nodetypes
options.c sh: Make getopts memory-safe if with changing arguments. 2014-10-26 17:50:33 +00:00
options.h sh: Make getopts memory-safe if with changing arguments. 2014-10-26 17:50:33 +00:00
output.c
output.h
parser.c sh: Allow backslash-newline continuation in more places: 2014-10-19 11:59:15 +00:00
parser.h
redir.c sh: Eliminate some gotos. 2014-10-05 21:51:36 +00:00
redir.h
sh.1 sh(1): Clarify that assignments before commands do not affect expansions. 2014-09-21 20:34:54 +00:00
shell.h
show.c
show.h
TOUR
trap.c sh: Eliminate some gotos. 2014-10-05 21:51:36 +00:00
trap.h
var.c
var.h