From b55bb06fb0adc99104eacf95c1f2e3745438f19f Mon Sep 17 00:00:00 2001 From: relnev Date: Wed, 8 Jan 2003 12:22:01 +0000 Subject: removed dirent type check (since it wouldn't work with symlinks as-is, plus the original code featured an invalid implication) git-svn-id: svn://svn.icculus.org/blackshades/trunk@47 5198baeb-e213-0410-be47-fc2ff85ca46f --- Source/Support.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Source/Support.cpp') diff --git a/Source/Support.cpp b/Source/Support.cpp index 3ce608e..9fcf2be 100644 --- a/Source/Support.cpp +++ b/Source/Support.cpp @@ -74,7 +74,12 @@ static int find_filename(char *filename) while (*ptr) { if (ptr == filename || *ptr == '/') { - cur = ptr+1; + if (*ptr == '/') { + cur = ptr+1; + } else { + cur = ptr; + } + if (*cur == 0) { /* hit the end */ break; @@ -109,9 +114,7 @@ static int find_filename(char *filename) } while ((dirent = readdir(dir)) != NULL) { - if (strcasecmp(cur, dirent->d_name) == 0 - && (dirent->d_type == DT_UNKNOWN || - (dirent->d_type == DT_DIR && next != NULL))) { + if (strcasecmp(cur, dirent->d_name) == 0) { strcpy(cur, dirent->d_name); break; } -- cgit v1.2.3