[tlbuild] Test failing on NetBSD

Marc Baudoin babafou at babafou.eu.org
Sun Jan 10 11:03:33 CET 2021


Karl Berry <karl at freefriends.org> écrit :
> The non-ASCII character in the test (0277) is intentional, although
> admittedly we could just clear it and get on with life. 
> 
> But, maybe iscntrl() on netbsd is returning true for that character?

It is.  The following program:

-----------------------------------------------------------------

#include <ctype.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>

int main ( void )
{
   int fd = open ( "postV3.afm" , O_RDONLY ) ;
   char buf[BUFSIZ] ;
   int n ;
   while ( n = read ( fd , buf , sizeof ( buf ) ) )
   {
      for ( int i = 0 ; i < n ; i ++ )
      {
         printf ( "%c\t%d\n" , buf[i] , iscntrl ( buf[i] ) ) ;
      }
   }
   close ( fd ) ;
}

-----------------------------------------------------------------

prints:

[...]
P       0
a       0
l       0
l       0
e       0
        0
J       0
<BF>    2	<<< this is the problem
r       0
g       0
e       0
n       0
s       0
e       0
n       0
[...]

> Whereas on other systems it's said to be true only for <040 or =0177.

Actually, it is:

-----------------------------------------------------------------

#include <ctype.h>
#include <stdio.h>

int main ( void )
{
   for ( int i = 0 ; i <= 255 ; i ++ )
   {
      if ( iscntrl ( i ) )
      {
         printf ( "%d " , i ) ;
      }
   }
   putchar ( '\n' ) ;
}

-----------------------------------------------------------------

This program prints:

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 127 

> Can you try changing that line to, say,
>   if (*p <= 31 || *p == '\r' || *p == '\n' || *p == '\t')
> and see if that helps?

It's worse, tests fail even more:

+ diff ../../../texk/web2c/pdftexdir/tests/postV3.afm postV3.afm
2,4c2,4
< FontName FonetikaDaniaIwonaeRegular
< FullName Fonetika Dania Iwonae Regular
< FamilyName FonetikaDaniaIwonae
---
> FontName 
> FullName 
> FamilyName 
11,12c11,12
< Version Version 001.000 
< Notice Created by Palle J�rgensen, with FontForge 1.0 (http://fontforge.sf.net)\nThe license is GUST Font Nosource License.
---
> Version 
> Notice �\n

+ diff ../../../texk/web2c/pdftexdir/tests/postV7.afm postV7.afm
2,4c2,4
< FontName FonetikaDaniaIwonaeRegular
< FullName Fonetika Dania Iwonae Regular
< FamilyName FonetikaDaniaIwonae
---
> FontName 
> FullName 
> FamilyName 
11,12c11,12
< Version Version 001.000 
< Notice Created by Palle J�rgensen, with FontForge 1.0 (http://fontforge.sf.net)\nThe license is GUST Font Nosource License.
---
> Version 
> Notice �\n


More information about the tlbuild mailing list.