summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/dir.c b/dir.c
index f451bfa48c..a870f42ddc 100644
--- a/dir.c
+++ b/dir.c
@@ -49,6 +49,15 @@ static enum path_treatment read_directory_recursive(struct dir_struct *dir,
int check_only, const struct pathspec *pathspec);
static int get_dtype(struct dirent *de, const char *path, int len);
+int count_slashes(const char *s)
+{
+ int cnt = 0;
+ while (*s)
+ if (*s++ == '/')
+ cnt++;
+ return cnt;
+}
+
int fspathcmp(const char *a, const char *b)
{
return ignore_case ? strcasecmp(a, b) : strcmp(a, b);