From cd2ade76c6d329f3116fbd686795bad6cb6f32b1 Mon Sep 17 00:00:00 2001
From: yorhel <yorhel@ce56bc8d-f834-0410-b703-f827bd498a76>
Date: Sat, 2 Aug 2008 11:14:48 +0000
Subject: [PATCH] Included patch from Cygwin package: Fix crash on names with
 slashes from /proc/registry

git-svn-id: svn://blicky.net/ncdu/trunk@33 ce56bc8d-f834-0410-b703-f827bd498a76
---
 src/calc.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/calc.c b/src/calc.c
index ddb0a15..c12a77a 100644
--- a/src/calc.c
+++ b/src/calc.c
@@ -275,6 +275,16 @@ int calcDir(struct dir *dest, char *path) {
     d->name = malloc(strlen(f)+1);
     strcpy(d->name, f);
 
+#ifdef __CYGWIN__
+   /* /proc/registry names may contain slashes */
+    if(strchr(d->name, '/') || strchr(d->name,  '\\')) {
+      serr = 1;
+      errno = 0;
+      d->flags |= FF_ERR;
+      continue;
+    }
+#endif
+
    /* get full path */
     strcpy(tmp, path);
     strcat(tmp, f);
-- 
GitLab