X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=m4%2Fdnslib.m4;h=5997262bc58f1b2eb6c3e051a3adfdf5c4dbf298;hb=8ee88613458f9f6249e03d6dfdd2c79e549ffd81;hp=414aa65c9121d08b69fe50bc0ae958dbd9a88f4a;hpb=baa16cd63bef05542b4d583923cb7f500de2bec5;p=nsc-5.git diff --git a/m4/dnslib.m4 b/m4/dnslib.m4 index 414aa65..5997262 100644 --- a/m4/dnslib.m4 +++ b/m4/dnslib.m4 @@ -28,10 +28,11 @@ define(nsc_file_name, `translit($1,/,@)') define(nsc_revIPa, `ifelse($#, 1, `$1', `nsc_revIPa(shift($@)).$1')') define(nsc_revaddr, `nsc_revIPa(translit($1, `.', `,'))') -# Fix up dots in a name: if the name is not simple (i.e., it contains at least one dot), -# ensure that it ends with a dot. +# Fix up dots in a name: If the name is not simple (i.e., it contains at least one unescaped +# dot), ensure that it ends with a dot. Then unescape all escaped dots (\.). -define(nsc_corr_dot, `ifelse(substr($1,decr(len($1))),.,$1,$1`'ifelse(index($1,.),-1,,.))') +define(nsc_name, `nsc_unescape_name(ifelse(substr($1,decr(len($1))),.,$1,$1`'ifelse(regexp($1,`[^\\]\.'),-1,,.)))') +define(nsc_unescape_name,`patsubst(`$1',\\\.,.)') # Normalize IPv6 address