* path.cc (suffix_scan::has): Change order of conditionals

to allow checking for .lnk suffixes even if in_suffixes is empty.
This commit is contained in:
Corinna Vinschen 2001-03-06 13:05:56 +00:00
parent 7cdc9feea1
commit bf11a54f54
2 changed files with 15 additions and 10 deletions

View File

@ -1,4 +1,9 @@
Tue Mar 6 13:02:00 2001 Jason Tiller <jtiller@sjm.com> Tue Mar 6 14:02:00 2001 Corinna Vinschen <corinna@vinschen.de>
* path.cc (suffix_scan::has): Change order of conditionals
to allow checking for .lnk suffixes even if in_suffixes is empty.
Tue Mar 6 13:02:00 2001 Corinna Vinschen <corinna@vinschen.de>
* autoload.c (cygwin_premain0): Add missing parameter. * autoload.c (cygwin_premain0): Add missing parameter.
* binmode.c (cygwin_premain0): Ditto. * binmode.c (cygwin_premain0): Ditto.

View File

@ -2426,10 +2426,10 @@ suffix_scan::has (const char *in_path, const suffix_info *in_suffixes, char **ex
suffixes = in_suffixes; suffixes = in_suffixes;
nullterm = 0; nullterm = 0;
state = SCAN_BEG; state = SCAN_BEG;
if (suffixes) ext_here = *ext_where = strrchr (in_path, '.');
if (ext_here)
{ {
ext_here = *ext_where = strrchr (in_path, '.'); if (suffixes)
if (ext_here)
{ {
/* Check if the extension matches a known extension */ /* Check if the extension matches a known extension */
for (const suffix_info *ex = in_suffixes; ex->name != NULL; ex++) for (const suffix_info *ex = in_suffixes; ex->name != NULL; ex++)
@ -2438,12 +2438,12 @@ suffix_scan::has (const char *in_path, const suffix_info *in_suffixes, char **ex
state = SCAN_JUSTCHECK; state = SCAN_JUSTCHECK;
goto known_suffix; goto known_suffix;
} }
/* Didn't match. Use last resort -- .lnk. */ }
if (strcasematch (ext_here, ".lnk")) /* Didn't match. Use last resort -- .lnk. */
{ if (strcasematch (ext_here, ".lnk"))
state = SCAN_LNK; {
goto known_suffix; state = SCAN_LNK;
} goto known_suffix;
} }
} }