aboutsummaryrefslogtreecommitdiffstats
path: root/libfat/searchdir.c
diff options
context:
space:
mode:
authorhpa <hpa>2005-01-04 03:04:53 +0000
committerhpa <hpa>2005-01-04 03:04:53 +0000
commit6c00ab2e9e714d5963f3dcf85c7dd100e02a08d1 (patch)
tree8220ce3f97b94d1a13926cf62cfccb26b7663f44 /libfat/searchdir.c
parent140970b0b6669dfeab8ee42720aab159e5ccd6b5 (diff)
downloadsyslinux.git-6c00ab2e9e714d5963f3dcf85c7dd100e02a08d1.tar.gz
syslinux.git-6c00ab2e9e714d5963f3dcf85c7dd100e02a08d1.tar.xz
syslinux.git-6c00ab2e9e714d5963f3dcf85c7dd100e02a08d1.zip
Use libfat to set the MS-DOS attributes when using the unix installer.
Diffstat (limited to 'libfat/searchdir.c')
-rw-r--r--libfat/searchdir.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libfat/searchdir.c b/libfat/searchdir.c
index 7c07165b..8b652682 100644
--- a/libfat/searchdir.c
+++ b/libfat/searchdir.c
@@ -23,7 +23,7 @@
#include "libfatint.h"
int32_t libfat_searchdir(struct libfat_filesystem *fs, int32_t dirclust,
- const void *name, void *direntry)
+ const void *name, struct libfat_direntry *direntry)
{
struct fat_dirent *dep;
int nent;
@@ -39,11 +39,14 @@ int32_t libfat_searchdir(struct libfat_filesystem *fs, int32_t dirclust,
if ( !dep )
return -1; /* Read error */
- for ( nent = LIBFAT_SECTOR_SIZE/sizeof(struct fat_dirent) ;
- nent ; nent-- ) {
+ for ( nent = 0 ; nent < LIBFAT_SECTOR_SIZE ;
+ nent += sizeof(struct fat_dirent) ) {
if ( !memcmp(dep->name, name, 11) ) {
- if ( direntry )
- memcpy(direntry, dep, sizeof (*dep));
+ if ( direntry ) {
+ memcpy(direntry->entry, dep, sizeof (*dep));
+ direntry->sector = s;
+ direntry->offset = nent;
+ }
if ( read32(&dep->size) == 0 )
return 0; /* An empty file has no clusters */
else