Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Feb 2023 02:56:13 GMT
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 82de173cbc81 - stable/12 - network.subr: Replace "\ " with "[[:space:]]"
Message-ID:  <202302010256.3112uDNt006678@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by cy:

URL: https://cgit.FreeBSD.org/src/commit/?id=82de173cbc81a09191ac23a2b2e2df3d83dd55ef

commit 82de173cbc81a09191ac23a2b2e2df3d83dd55ef
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-12-21 16:06:02 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2023-02-01 02:55:19 +0000

    network.subr: Replace "\ " with "[[:space:]]"
    
    "[[:space:]]" is easier to read than "\ " and is conisitent with
    clone_up().
    
    Reported by:    eugen
    Differential Revision:  https://reviews.freebsd.org/D37748
    
    (cherry picked from commit fef0e429f190d396d5b3228166a012e85dd912f2)
---
 libexec/rc/network.subr | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/libexec/rc/network.subr b/libexec/rc/network.subr
index 623c3d95b32e..793784f8c927 100644
--- a/libexec/rc/network.subr
+++ b/libexec/rc/network.subr
@@ -709,7 +709,7 @@ ipv4_down()
 	for _inet in $inetList ; do
 		# get rid of extraneous line
 		case $_inet in
-		inet\ *)	;;
+		inet[[:space:]]*)	;;
 		*)		continue ;;
 		esac
 
@@ -749,7 +749,7 @@ ipv6_down()
 	for _inet6 in $inetList ; do
 		# get rid of extraneous line
 		case $_inet6 in
-		inet6\ *)	;;
+		inet6[[:space:]]*)	;;
 		*)		continue ;;
 		esac
 
@@ -1016,7 +1016,7 @@ ifalias_af_common_handler()
 	_args=$*
 
 	case $_args in
-	${_af}\ *)	;;
+	${_af}[[:space:]]*)	;;
 	*)	return	;;
 	esac
 
@@ -1030,11 +1030,11 @@ ifalias_af_common_handler()
 		case $_c in
 		${_af})
 			case $_tmpargs in
-			${_af}\ *[0-9a-fA-F]-*)
+			${_af}[[:space:]]*[0-9a-fA-F]-*)
 				ifalias_af_common_handler $_if $_af $_action \
-				`ifalias_expand_addr $_af $_action ${_tmpargs#${_af}\ }`
+				`ifalias_expand_addr $_af $_action ${_tmpargs#${_af}[[:space:]]}`
 			;;
-			${_af}\ *)
+			${_af}[[:space:]]*)
 				${IFCONFIG_CMD} $_if $_tmpargs $_action && _ret=0
 			;;
 			esac
@@ -1048,11 +1048,11 @@ ifalias_af_common_handler()
 	# Process the last component if any.
 	if [ -n "${_tmpargs}" ]; then
 		case $_tmpargs in
-		${_af}\ *[0-9a-fA-F]-*)
+		${_af}[[:space:]]*[0-9a-fA-F]-*)
 			ifalias_af_common_handler $_if $_af $_action \
-			`ifalias_expand_addr $_af $_action ${_tmpargs#${_af}\ }`
+			`ifalias_expand_addr $_af $_action ${_tmpargs#${_af}[[:space:]]}`
 		;;
-		${_af}\ *)
+		${_af}[[:space:]]*)
 			${IFCONFIG_CMD} $_if $_tmpargs $_action && _ret=0
 		;;
 		esac
@@ -1085,10 +1085,10 @@ ifalias_af_common()
 		eval ifconfig_args=\"\$$alias\"
 		_iaf=
 		case $ifconfig_args in
-		inet\ *)	_iaf=inet ;;
-		inet6\ *)	_iaf=inet6 ;;
-		link\ *)	_iaf=link ;;
-		ether\ *)	_iaf=ether ;;
+		inet[[:space:]]*)	_iaf=inet ;;
+		inet6[[:space:]]*)	_iaf=inet6 ;;
+		link[[:space:]]*)	_iaf=link ;;
+		ether[[:space:]]*)	_iaf=ether ;;
 		esac
 
 		case ${_af}:${_action}:${_iaf}:"${ifconfig_args}" in
@@ -1136,7 +1136,7 @@ ifalias_af_common()
 		case $_c in
 		inet|inet6|link|ether)
 			case $_tmpargs in
-			${_af}\ *)
+			${_af}[[:space:]]*)
 				eval ifalias_af_common_handler $_if $_af $_action $_tmpargs && _ret=0
 			;;
 			esac
@@ -1148,7 +1148,7 @@ ifalias_af_common()
 	done
 	# Process the last component
 	case $_tmpargs in
-	${_af}\ *)
+	${_af}[[:space:]]*)
 		ifalias_af_common_handler $_if $_af $_action $_tmpargs && _ret=0
 	;;
 	esac
@@ -1259,7 +1259,7 @@ wlan_up()
 			create_args="wlandev $parent `get_if_var $child create_args_IF`"
 			debug_flags="`get_if_var $child wlandebug_IF`"
 			case $_iflist in
-			""|$child|$child\ *|*\ $child\ *|*\ $child)	;;
+			""|$child|$child[[:space:]]*|*[[:space:]]$child[[:space:]]*|*[[:space:]]$child)	;;
 			*)	continue ;;
 			esac
 			# Skip if ${child} already exists.
@@ -1299,7 +1299,7 @@ wlan_down()
 		child_wlans=`get_if_var $parent wlans_IF`
 		for child in ${child_wlans}; do
 			case $_iflist in
-			""|$child|$child\ *|*\ $child\ *|*\ $child)	;;
+			""|$child|$child[[:space:]]*|*[[:space:]]$child[[:space:]]*|*[[:space:]]$child)	;;
 			*)	continue ;;
 			esac
 			# Skip if ${child} doesn't exists.
@@ -1332,7 +1332,7 @@ clone_up()
 		# Parse ifn:ifopt.
 		OIFS=$IFS; IFS=:; set -- $ifn; ifn=$1; ifopt=$2; IFS=$OIFS
 		case $_iflist in
-		""|$ifn|$ifn\ *|*\ $ifn\ *|*\ $ifn)	;;
+		""|$ifn|$ifn[[:space:]]*|*[[:space:]]$ifn[[:space:]]*|*[[:space:]]$ifn)	;;
 		*)	continue ;;
 		esac
 		case $ifn in
@@ -1368,7 +1368,7 @@ clone_up()
 		# Parse ifn:ifopt.
 		OIFS=$IFS; IFS=:; set -- $ifn; ifn=$1; ifopt=$2; IFS=$OIFS
 		case $_iflist in
-		""|$ifn|$ifn\ *|*\ $ifn\ *|*\ $ifn)	;;
+		""|$ifn|$ifn[[:space:]]*|*[[:space:]]$ifn[[:space:]]*|*[[:space:]]$ifn)	;;
 		*)	continue ;;
 		esac
 		# Skip if ifn already exists.
@@ -1433,7 +1433,7 @@ clone_down()
 		*:1)		continue ;;	# global sticky knob == 1
 		esac
 		case $_iflist in
-		""|$ifn|$ifn\ *|*\ $ifn\ *|*\ $ifn)	;;
+		""|$ifn|$ifn[[:space:]]*|*[[:space:]]$ifn[[:space:]]*|*[[:space:]]$ifn)	;;
 		*)	continue ;;
 		esac
 		case $ifn in



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202302010256.3112uDNt006678>