Skip to content
Snippets Groups Projects
Commit cd2ade76 authored by yorhel's avatar yorhel
Browse files

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
parent 6621d70d
No related branches found
No related tags found
No related merge requests found
...@@ -275,6 +275,16 @@ int calcDir(struct dir *dest, char *path) { ...@@ -275,6 +275,16 @@ int calcDir(struct dir *dest, char *path) {
d->name = malloc(strlen(f)+1); d->name = malloc(strlen(f)+1);
strcpy(d->name, f); 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 */ /* get full path */
strcpy(tmp, path); strcpy(tmp, path);
strcat(tmp, f); strcat(tmp, f);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment