Page MenuHomeFreeBSD

D18481.diff
No OneTemporary

D18481.diff

Index: head/libexec/rc/rc.subr
===================================================================
--- head/libexec/rc/rc.subr
+++ head/libexec/rc/rc.subr
@@ -58,17 +58,29 @@
# ---------
# list_vars pattern
-# List vars matching pattern.
+# List variables matching glob pattern.
#
list_vars()
{
- set | { while read LINE; do
- var="${LINE%%=*}"
- case "$var" in
- "$LINE"|*[!a-zA-Z0-9_]*) continue ;;
- $1) echo $var
+ # Localize 'set' option below.
+ local -
+ local IFS=$'\n' line varname
+
+ # Disable path expansion in unquoted 'for' parameters below.
+ set -o noglob
+
+ for line in $(set); do
+ varname="${line%%=*}"
+
+ case "$varname" in
+ "$line"|*[!a-zA-Z0-9_]*)
+ continue
+ ;;
+ $1)
+ echo $varname
+ ;;
esac
- done; }
+ done
}
# set_rcvar [var] [defval] [desc]

File Metadata

Mime Type
text/plain
Expires
Tue, Jan 21, 9:30 AM (21 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16006472
Default Alt Text
D18481.diff (805 B)

Event Timeline