bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gawk] Detection of libreadline fails on Solaris for gawk 4.1.0


From: Dagobert Michelsen
Subject: [bug-gawk] Detection of libreadline fails on Solaris for gawk 4.1.0
Date: Fri, 4 Oct 2013 14:10:14 +0200

Hi,

the detection of libreadline is failing for gawk 4.1.0 on Solaris 10 Sparc
with Sun Studio 12. The detection code in m4/readline.m4 says:

>         fd = open("/dev/null", 2);      /* should get fd 0 */
>         dup(fd);
>         line = readline("giveittome> ");
> 
>         printf("got <%s>\n", line);

However, readline(3) indicates that the result of deadline() is NULL if
EOF is encountered:

> "If EOF is encountered while reading a line, and the line is empty, NULL is 
> returned"

The resulting is a coredumping test as printf does not print NULL on
zero pointers to strings. I suggest something like

  printf("got <%s>\n", line ? line : "(NULL)");


Best regards

  -- Dago

-- 
"You don't become great by trying to be great, you become great by wanting to 
do something,
and then doing it so hard that you become great in the process." - xkcd #896

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]