mercurial/cext/dirs.c
changeset 42343 d8e55c0c642c
parent 34438 b90e8da190da
child 43149 2a0774e9d2a8
--- a/mercurial/cext/dirs.c	Thu Jul 13 23:43:16 2017 -0700
+++ b/mercurial/cext/dirs.c	Tue May 16 11:00:38 2017 -0700
@@ -42,6 +42,9 @@
 			break;
 		pos -= 1;
 	}
+	if (pos == -1) {
+	  return 0;
+	}
 
 	return pos;
 }