From ff1273767b36aba976ea7dc6a65ae1dcb05492cb Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Sun, 15 May 2016 09:31:51 +0100 Subject: [PATCH] path.cc: Ignore zero-length exclusions --- winsup/cygwin/path.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index d82b9896cd..81556b2a32 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -3535,7 +3535,7 @@ arg_heuristic_with_exclusions (char const * const arg, char const * exclusions, { /* Since we've got regex linked we should maybe switch to that, but running regexes for every argument could be too slow. */ - if ( strcmp (exclusions, "*") == 0 || strstr (arg, exclusions) == arg ) + if ( strcmp (exclusions, "*") == 0 || (strlen (exclusions) && strstr (arg, exclusions) == arg) ) return (char*)arg; exclusions += strlen (exclusions) + 1; }