[Top][All Lists]

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

Re: -P needs to allow dots in its argument.

From: Peter Schaffter
Subject: Re: -P needs to allow dots in its argument.
Date: Tue, 4 Aug 2020 13:16:32 -0400
User-agent: Mutt/1.9.4 (2018-02-28)

On Sun, Aug 02, 2020, T. Kurt Bond wrote:
> The linux version of homebrew installs groff's data directory in
> /home/linuxbrew/.linuxbrew/share/groff by default.
> I must have cargo culted the check_optarg without checking everything out
> when I added the -P option.  I've attached a patch to to
> make it check that the argument to -P is a directory and that it is
> writable.

Good.  Thanks.  Patch has been applied to on the mom
> I kept the check that the argument doesn't start with a dash, even though
> someone evil might start their directory with a dash.  Should that check be
> dropped?

Bash parses getopts in a rudimentary fashion that doesn't
distinguish between an option and an argument.  Given the choice
between checking for evil (starting a dirname with a dash) and
checking for absentmindedness (forgetting to supply the dirname),
better to opt for the latter.  Although these days it sometimes
doesn't seem so, there's far more absentmindedness in the world than
evil. :)

Peter Schaffter

reply via email to

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