diff options
| author | relnev <relnev@5198baeb-e213-0410-be47-fc2ff85ca46f> | 2003-01-08 12:22:01 +0000 |
|---|---|---|
| committer | relnev <relnev@5198baeb-e213-0410-be47-fc2ff85ca46f> | 2003-01-08 12:22:01 +0000 |
| commit | b55bb06fb0adc99104eacf95c1f2e3745438f19f (patch) | |
| tree | aa8867d818fea336419220cccb2f92a139d5c98d /Source/Support.cpp | |
| parent | dcf0153b0c4cee132a3ce21bab2b222ed3703bc5 (diff) | |
| download | blackshades-b55bb06fb0adc99104eacf95c1f2e3745438f19f.tar.gz | |
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
Diffstat (limited to 'Source/Support.cpp')
| -rw-r--r-- | Source/Support.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
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; } |
