From a000053494e580dfdbfa2d679b9a413f0391fafa Mon Sep 17 00:00:00 2001 From: Alexander Hall Date: Tue, 12 May 2009 09:05:55 +0000 Subject: Cleanup and shave some bytes in hextodec() ok krw@, "If that works, commit it" deraadt@ --- distrib/miniroot/install.sub | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'distrib') diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 30d1cbb75fc..7eaab5b62f9 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,4 +1,4 @@ -# $OpenBSD: install.sub,v 1.544 2009/05/09 22:41:01 martynas Exp $ +# $OpenBSD: install.sub,v 1.545 2009/05/12 09:05:54 halex Exp $ # $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $ # # Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback @@ -694,10 +694,10 @@ __EOT hextodec() { local _d _b - for _b in $(echo $1 | sed -e 's/0x\(..\)\(..\)\(..\)\(..\)/\1 \2 \3 \4/'); do - _d=${_d}.$((16#$_b)) + for _b in $(echo ${1#0x} | sed 's/\(..\)/\1 /g'); do + _d=$_d.$((0x$_b)) done - echo $_d | sed -e 's/^\.//' + echo ${_d#.} } v4_config() { -- cgit v1.2.3