Fix a bug in diff-remove-x509-names canonifier

The last field in a log was being ignored, due to an off-by-one
error in a "for" loop.  Also simplified the script by combining
two patterns into one.
This commit is contained in:
Daniel Thayer 2015-09-20 00:21:04 -05:00
parent 6df54a3168
commit b1d1d90de4

View file

@ -5,8 +5,10 @@
BEGIN { FS="\t"; OFS="\t"; s_col = -1; i_col = -1; is_col = -1; cs_col = -1; ci_col = -1; cert_subj_col = -1; cert_issuer_col = -1 }
/^#fields/ {
for ( i = 2; i < NF; ++i )
/^#/ {
if ( $1 == "#fields" )
{
for ( i = 2; i <= NF; ++i )
{
if ( $i == "subject" )
s_col = i-1;
@ -23,9 +25,8 @@ BEGIN { FS="\t"; OFS="\t"; s_col = -1; i_col = -1; is_col = -1; cs_col = -1; ci_
if ( $i == "certificate.issuer" )
cert_issuer_col = i-1;
}
}
}
/^#/ {
print;
next;
}