mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 01:08:41 -09:00
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
This commit is contained in:
parent
6621d70d99
commit
cd2ade76c6
1 changed files with 10 additions and 0 deletions
10
src/calc.c
10
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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue