Improve ipv6addr_terse().
Drop leading zeros in IPv6 address segment.
This commit is contained in:
parent
831552abc6
commit
393cdf120f
@ -61,7 +61,7 @@ ipv6addr_terse()
|
||||
::*) echo "$1" | sed -r 's/^::[0:]+:/::/' ;;
|
||||
*::*) echo "$1" ;;
|
||||
*) echo "$1" | sed -r 's/(:[0:]+:|^[0:]+:|:[0:]+$)/::/' ;;
|
||||
esac
|
||||
esac | sed -r 's/(^|:)(0+)([[:xdigit:]])/\1\3/g'
|
||||
}
|
||||
|
||||
ipv6addr_expand()
|
||||
|
Loading…
x
Reference in New Issue
Block a user