From 714be60e59f2a05b568c5f577ae44a9928e48df0 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Sat, 25 Oct 1997 05:24:52 +0000 Subject: [PATCH] Allow specifying table-base. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3660 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/com_err/compile_et.awk | 8 ++++++-- lib/error/compile_et.awk | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/com_err/compile_et.awk b/lib/com_err/compile_et.awk index a9e6e947f..d0f119e79 100644 --- a/lib/com_err/compile_et.awk +++ b/lib/com_err/compile_et.awk @@ -8,8 +8,12 @@ $1 == "error_table" || $1 == "et" { name = $2 base = 0 - for(i = 1; i <= length(name); i++){ - base = base * 64 + index("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_", substr(name, i, 1)) + if(NF < 3) + base_str = name + else + base_str = $3 + for(i = 1; i <= length(base_str); i++){ + base = base * 64 + index("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_", substr(base_str, i, 1)) } base *= 256 if(base >= 2147483648){ # 0x80000000 diff --git a/lib/error/compile_et.awk b/lib/error/compile_et.awk index a9e6e947f..d0f119e79 100644 --- a/lib/error/compile_et.awk +++ b/lib/error/compile_et.awk @@ -8,8 +8,12 @@ $1 == "error_table" || $1 == "et" { name = $2 base = 0 - for(i = 1; i <= length(name); i++){ - base = base * 64 + index("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_", substr(name, i, 1)) + if(NF < 3) + base_str = name + else + base_str = $3 + for(i = 1; i <= length(base_str); i++){ + base = base * 64 + index("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_", substr(base_str, i, 1)) } base *= 256 if(base >= 2147483648){ # 0x80000000