diff options
Diffstat (limited to 'etc/etc.mvme68k')
-rw-r--r-- | etc/etc.mvme68k/MAKEDEV | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/etc/etc.mvme68k/MAKEDEV b/etc/etc.mvme68k/MAKEDEV index c964dbebbf4..0642839e566 100644 --- a/etc/etc.mvme68k/MAKEDEV +++ b/etc/etc.mvme68k/MAKEDEV @@ -4,7 +4,7 @@ # generated from: # # OpenBSD: etc.mvme68k/MAKEDEV.md,v 1.9 2003/09/26 06:58:02 miod Exp -# OpenBSD: MAKEDEV.mi,v 1.61 2003/10/11 03:32:15 tedu Exp +# OpenBSD: MAKEDEV.mi,v 1.62 2003/10/14 17:58:23 todd Exp # OpenBSD: MAKEDEV.sub,v 1.8 2003/06/18 18:08:59 todd Exp # # @@ -82,15 +82,24 @@ hex() esac } -trunc() +h2d() { - # XXX pdksh can't seem to deal with locally scoped variables - # in ${foo#$bar} expansions - arg1="$1" - arg2="$2" - case $3 in - l) echo ${arg2#$arg1} ;; - r|*) echo ${arg1#$arg2} ;; + local s="$1" + local f=${s%*[0-9a-f]} n=${s#[0-9a-f]*} + + echo $(($(_h2d $f)*16+ $(_h2d $n) )) +} + +_h2d() +{ + case $1 in + [0-9]) echo -n $1;; + a) echo -n 10;; + b) echo -n 11;; + c) echo -n 12;; + d) echo -n 13;; + e) echo -n 14;; + f) echo -n 15;; esac } |