Deleted Added
full compact
dosfs.c (201937) dosfs.c (221365)
1/*
2 * Copyright (c) 1996, 1998 Robert Nordier
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 12 unchanged lines hidden (view full) ---

21 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
23 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
25 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1996, 1998 Robert Nordier
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 12 unchanged lines hidden (view full) ---

21 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
23 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
25 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/lib/libstand/dosfs.c 201937 2010-01-09 22:33:34Z marcel $");
29__FBSDID("$FreeBSD: head/lib/libstand/dosfs.c 221365 2011-05-03 07:43:47Z rodrigc $");
30
31/*
32 * Readonly filesystem for Microsoft FAT12/FAT16/FAT32 filesystems,
33 * also supports VFAT.
34 */
35
36#include <sys/types.h>
37#include <string.h>

--- 315 unchanged lines hidden (view full) ---

353 if ((sb->st_size = fsize(f->fs, &f->de)) == -1)
354 return EINVAL;
355 return (0);
356}
357
358static int
359dos_readdir(struct open_file *fd, struct dirent *d)
360{
30
31/*
32 * Readonly filesystem for Microsoft FAT12/FAT16/FAT32 filesystems,
33 * also supports VFAT.
34 */
35
36#include <sys/types.h>
37#include <string.h>

--- 315 unchanged lines hidden (view full) ---

353 if ((sb->st_size = fsize(f->fs, &f->de)) == -1)
354 return EINVAL;
355 return (0);
356}
357
358static int
359dos_readdir(struct open_file *fd, struct dirent *d)
360{
361 DOS_FILE *f = (DOS_FILE *)fd->f_fsdata;
361 /* DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; */
362 u_char fn[261];
363 DOS_DIR dd;
364 size_t res;
365 u_int chk, i, x, xdn;
366 int err;
367
368 x = chk = 0;
369 while (1) {

--- 39 unchanged lines hidden (view full) ---

409 } else {
410 cp_sfn(fn, &dd.de);
411 break;
412 }
413 x = 0;
414 }
415 }
416
362 u_char fn[261];
363 DOS_DIR dd;
364 size_t res;
365 u_int chk, i, x, xdn;
366 int err;
367
368 x = chk = 0;
369 while (1) {

--- 39 unchanged lines hidden (view full) ---

409 } else {
410 cp_sfn(fn, &dd.de);
411 break;
412 }
413 x = 0;
414 }
415 }
416
417 d->d_fileno = dd.de.clus[1] << 8 + dd.de.clus[0];
417 d->d_fileno = (dd.de.clus[1] << 8) + dd.de.clus[0];
418 d->d_reclen = sizeof(*d);
419 d->d_type = (dd.de.attr & FA_DIR) ? DT_DIR : DT_REG;
420 memcpy(d->d_name, fn, sizeof(d->d_name));
421 return(0);
422}
423
424/*
425 * Parse DOS boot sector

--- 350 unchanged lines hidden ---
418 d->d_reclen = sizeof(*d);
419 d->d_type = (dd.de.attr & FA_DIR) ? DT_DIR : DT_REG;
420 memcpy(d->d_name, fn, sizeof(d->d_name));
421 return(0);
422}
423
424/*
425 * Parse DOS boot sector

--- 350 unchanged lines hidden ---