+2019-09-14 Bruno Haible <bruno@clisp.org>
+
+ findprog-in: Better mimic the system on native Windows.
+ Reported by Paul Smith <psmith@gnu.org>.
+ * lib/findprog-in.c (find_in_given_path): On native Windows, don't try
+ non-empty suffixes when the file name already contains a '.'.
+
2019-09-10 Bruno Haible <bruno@clisp.org>
wctob: Fix autoconf test.
const char *suffix = suffixes[i];
#if defined _WIN32 && !defined __CYGWIN__ /* Native Windows */
- /* File names without a '.' are not considered executable. */
- if (*suffix != '\0' || strchr (progbasename, '.') != NULL)
+ /* File names without a '.' are not considered executable, and
+ for file names with a '.' no additional suffix is tried. */
+ if ((*suffix != '\0') != (strchr (progbasename, '.') != NULL))
#endif
{
/* Concatenate progname and suffix. */
const char *suffix = suffixes[i];
#if defined _WIN32 && !defined __CYGWIN__ /* Native Windows */
- /* File names without a '.' are not considered executable. */
- if (*suffix != '\0' || strchr (progname, '.') != NULL)
+ /* File names without a '.' are not considered executable, and
+ for file names with a '.' no additional suffix is tried. */
+ if ((*suffix != '\0') != (strchr (progname, '.') != NULL))
#endif
{
/* Concatenate dir, progname, and suffix. */