diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-05-29 15:10:33 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-05-29 15:10:33 -0700 |
commit | 063b132382d8e4fa9ae05cf00539557a1e201675 (patch) | |
tree | 36b50c0ceec179f6b96ed300098434d4b355fbb6 /libfat | |
parent | fe91ddaa3ab16f2fe692b76928964b2a3c5a7d85 (diff) | |
download | syslinux.git-063b132382d8e4fa9ae05cf00539557a1e201675.tar.gz syslinux.git-063b132382d8e4fa9ae05cf00539557a1e201675.tar.xz syslinux.git-063b132382d8e4fa9ae05cf00539557a1e201675.zip |
Run Nindent on libfat/searchdir.c
Automatically reformat libfat/searchdir.c using Nindent.
Do this for all files except HDT, gPXE and externally maintained
libraries (zlib, tinyjpeg, libpng).
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'libfat')
-rw-r--r-- | libfat/searchdir.c | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/libfat/searchdir.c b/libfat/searchdir.c index 6fcde139..4964120b 100644 --- a/libfat/searchdir.c +++ b/libfat/searchdir.c @@ -24,40 +24,41 @@ int32_t libfat_searchdir(struct libfat_filesystem *fs, int32_t dirclust, const void *name, struct libfat_direntry *direntry) { - struct fat_dirent *dep; - int nent; - libfat_sector_t s = libfat_clustertosector(fs, dirclust); - - while ( 1 ) { - if ( s == 0 ) - return -2; /* Not found */ - else if ( s == (libfat_sector_t)-1 ) - return -1; /* Error */ - - dep = libfat_get_sector(fs, s); - if ( !dep ) - return -1; /* Read error */ - - for ( nent = 0 ; nent < LIBFAT_SECTOR_SIZE ; - nent += sizeof(struct fat_dirent) ) { - if ( !memcmp(dep->name, name, 11) ) { - 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 - return read16(&dep->clustlo) + (read16(&dep->clusthi) << 16); - } + struct fat_dirent *dep; + int nent; + libfat_sector_t s = libfat_clustertosector(fs, dirclust); - if ( dep->name[0] == 0 ) - return -2; /* Hit high water mark */ + while (1) { + if (s == 0) + return -2; /* Not found */ + else if (s == (libfat_sector_t) - 1) + return -1; /* Error */ - dep++; - } + dep = libfat_get_sector(fs, s); + if (!dep) + return -1; /* Read error */ + + for (nent = 0; nent < LIBFAT_SECTOR_SIZE; + nent += sizeof(struct fat_dirent)) { + if (!memcmp(dep->name, name, 11)) { + 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 + return read16(&dep->clustlo) + + (read16(&dep->clusthi) << 16); + } + + if (dep->name[0] == 0) + return -2; /* Hit high water mark */ - s = libfat_nextsector(fs, s); - } + dep++; + } + + s = libfat_nextsector(fs, s); + } } |