Subject: bug#36357: Wrong Ghostscript program name on MS Win

From: Tassilo Horn <[email-masked]>
Date: Wed, 22 Apr 2020 16:14:41 +0200

Eli Zaretskii <[email-masked]> writes:

>> Another question: You both used executable-find with exe file
>> extension.  Was that intended?  I mean, it makes sure we don't
>> falsely set some "gs.bat" or "gs.cmd" which might have nothing to do
>> with GhostScript.  Is that a real danger?  If so, we need the OS
>> distinction again.
>
> It is IME wrong and user-unfriendly to refuse to load foo.bat or
> foo.cmd and insist on running foo.exe.  The reason is that having a
> batch file that shadows a .exe program is the easiest way of
> "customizing" programs, like adding default arguments, setting up a
> special PATH value, etc.

I agree, and I will omit the extension at least for gs{64,32}winc.  The
question is more how likely it is that some user has her own "rungs"
command/batch script which has nothing to do with "running GhostScript"
and then we call it in doc-view.  I mean, "rungs" is at least an English
word...

> P.S. This is not Windows-specific, IMO: the same is true on Posix
> systems where a shell script can "shadow" a program.

Sure, but I guess that users on POSIX systems take a bit more care in
naming their scripts, i.e., if their ~/bin/foo shadows /usr/bin/foo
that's most probably wanted for the very reasons you described.  On
Windows, where most programs install everything they need in their own
installation directory instead of assuming the dependencies were
installed individually (by a package manager), such a habit of PATH
hygiene (unambiguous naming xor shadowing on purpose) might not be so
common.

Bye,
Tassilo