mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2026-10-01 01:04:29 +00:00
allow network interface to contain colon
This commit is contained in:
+1
-1
@@ -3052,7 +3052,7 @@ function _p9k_set_iface() {
|
|||||||
local line
|
local line
|
||||||
local iface
|
local iface
|
||||||
for line in ${(f)"$(/sbin/ifconfig 2>/dev/null)"}; do
|
for line in ${(f)"$(/sbin/ifconfig 2>/dev/null)"}; do
|
||||||
if [[ $line == (#b)([^[:space:]:]##):[[:space:]]##flags=(<->)'<'* ]]; then
|
if [[ $line == (#b)([^[:space:]]##):[[:space:]]##flags=(<->)'<'* ]]; then
|
||||||
[[ $match[2] == *[13579] ]] && iface=$match[1] || iface=
|
[[ $match[2] == *[13579] ]] && iface=$match[1] || iface=
|
||||||
elif [[ -n $iface && $line == (#b)[[:space:]]##inet[[:space:]]##([0-9.]##)* ]]; then
|
elif [[ -n $iface && $line == (#b)[[:space:]]##inet[[:space:]]##([0-9.]##)* ]]; then
|
||||||
_p9k_iface[$iface]=$match[1]
|
_p9k_iface[$iface]=$match[1]
|
||||||
|
|||||||
Reference in New Issue
Block a user