diff mercurial/cext/dirs.c @ 42343:d8e55c0c642c

util: make util.dirs() and util.finddirs() include root directory (API) This changes the behavior of test-origbackup-conflict.t so it no longer errors out when the backup path points to an existing file. Instead, it replaces the file by a directory. That seems reasonable to me. Differential Revision: https://phab.mercurial-scm.org/D6403
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 16 May 2017 11:00:38 -0700
parents b90e8da190da
children 2a0774e9d2a8
line wrap: on
line diff
--- 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;
 }