On Mon, Sep 04, 2017 at 11:43:56AM -0500, Scott Cheloha wrote:
> Thoughts?

The PATH_MAX check was introduced in rev 1.10 1997/09/23.  That was
after the doumentation, so it might be a mistake that the man page
was not updated.

The feature worked for 20 years, I see no reason to remove it.

Personally I prefer to see the error when something goes wrong.

bluhm

> Index: usr.bin/readlink/readlink.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/readlink/readlink.c,v
> retrieving revision 1.27
> diff -u -p -r1.27 readlink.c
> --- usr.bin/readlink/readlink.c       9 Oct 2015 01:37:08 -0000       1.27
> +++ usr.bin/readlink/readlink.c       4 Sep 2017 15:57:47 -0000
> @@ -64,14 +64,6 @@ main(int argc, char *argv[])
>       if (argc != 1)
>               usage();
>  
> -     n = strlen(argv[0]);
> -     if (n > PATH_MAX - 1) {
> -             fprintf(stderr,
> -                 "readlink: filename longer than PATH_MAX-1 (%d)\n",
> -                 PATH_MAX - 1);
> -             exit(1);
> -     }
> -
>       if (fflag) {
>               if (realpath(argv[0], buf) == NULL)
>                       err(1, "%s", argv[0]);

Reply via email to