summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/path.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index a132a0a7e..94f4e887c 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -57,6 +57,7 @@
#include <sys/param.h>
#include <sys/cygwin.h>
#include <wctype.h>
+#include <assert.h>
#include "cygerrno.h"
#include "path.h"
#include "fhandler.h"
@@ -2800,7 +2801,7 @@ restart:
if (*p != '.' && *p != ' ')
{
while (*--p != '\\')
- ;
+ assert(p >= path);
if (*++p != ' ')
p = NULL;
}