From 57499703f25428a4b4274cf1bdbd9771927a74b8 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 17 Mar 2001 17:44:53 +0000 Subject: [PATCH] * path.cc (suffix_scan::next): Avoid searching for foo.lnk twice when input is "foo". --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/path.cc | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 5b224913a..fc6af7420 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +Sat Mar 17 12:43:15 2001 Christopher Faylor + + * path.cc (suffix_scan::next): Avoid searching for foo.lnk twice when + input is "foo". + Sat Mar 17 18:10:00 2001 Corinna Vinschen * net.cc (cygwin_socket): Set protocol to 0 when address family is diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 24c295f1c..b95182d66 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2472,10 +2472,14 @@ suffix_scan::next () { case SCAN_BEG: suffixes = suffixes_start; - if (suffixes) - nextstate = SCAN_EXTRALNK; - else + if (!suffixes) nextstate = SCAN_LNK; + else + { + if (!*suffixes->name) + suffixes++; + nextstate = SCAN_EXTRALNK; + } return 1; case SCAN_HASLNK: nextstate = SCAN_EXTRALNK; /* Skip SCAN_BEG */