From 284a55c33e0739e57436e02460b7997c3e70253f Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 8 Apr 2004 01:33:00 +0000 Subject: * path.cc (path_prefix_p): Optimize test order. --- winsup/cygwin/path.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/path.cc') diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 7ed2ee778..0ece42dd9 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -161,10 +161,10 @@ path_prefix_p (const char *path1, const char *path2, int len1) if (len1 == 0) return isdirsep (path2[0]) && !isdirsep (path2[1]); - if (!pathnmatch (path1, path2, len1)) - return 0; + if (isdirsep (path2[len1]) || path2[len1] == 0 || path1[len1 - 1] == ':') + return pathnmatch (path1, path2, len1); - return isdirsep (path2[len1]) || path2[len1] == 0 || path1[len1 - 1] == ':'; + return 0; } /* Return non-zero if paths match in first len chars. -- cgit v1.2.3