Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-03-06 16:05:56 +0300
committerCorinna Vinschen <corinna@vinschen.de>2001-03-06 16:05:56 +0300
commitbf11a54f54d43142f3b05258239a1964bf4693cc (patch)
tree95d7a196d9b3881f729e17aca8bd638d95fdb760 /winsup/cygwin/path.cc
parent7cdc9feea1d8fcd016a842155c30308e4a0cae3d (diff)
* path.cc (suffix_scan::has): Change order of conditionals
to allow checking for .lnk suffixes even if in_suffixes is empty.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index cf026fe82..94111ad12 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2426,10 +2426,10 @@ suffix_scan::has (const char *in_path, const suffix_info *in_suffixes, char **ex
suffixes = in_suffixes;
nullterm = 0;
state = SCAN_BEG;
- if (suffixes)
+ ext_here = *ext_where = strrchr (in_path, '.');
+ if (ext_here)
{
- ext_here = *ext_where = strrchr (in_path, '.');
- if (ext_here)
+ if (suffixes)
{
/* Check if the extension matches a known extension */
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;
goto known_suffix;
}
- /* Didn't match. Use last resort -- .lnk. */
- if (strcasematch (ext_here, ".lnk"))
- {
- state = SCAN_LNK;
- goto known_suffix;
- }
+ }
+ /* Didn't match. Use last resort -- .lnk. */
+ if (strcasematch (ext_here, ".lnk"))
+ {
+ state = SCAN_LNK;
+ goto known_suffix;
}
}