Removing whitespaces in all files at EOL and EOF.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
This commit is contained in:
parent
1410138d03
commit
b4feb7319f
@ -8,7 +8,7 @@
|
||||
(superblock) format of DOS 3.3+, with support for volume ID's and
|
||||
volume labels (volume labels are also written to the root
|
||||
directory, as they should).
|
||||
|
||||
|
||||
18th February 1994 Dave Hudson (dave@humbug.demon.co.uk)
|
||||
|
||||
Released version 0.2 - clears a bug in the FAT sizing code.
|
||||
|
||||
@ -12,4 +12,3 @@
|
||||
|
||||
- dosfsck: read-only sector test (-t without -a or -r); just print
|
||||
out errors.
|
||||
|
||||
|
||||
@ -97,7 +97,7 @@ added to the free disk space except in auto mode (\fB-a\fP).
|
||||
List path names of files being processed.
|
||||
.IP \fB\-n\fP
|
||||
No-operation mode: non-interactively check for errors, but don't write
|
||||
anything to the filesystem.
|
||||
anything to the filesystem.
|
||||
.IP \fB\-r\fP
|
||||
Interactively repair the file system. The user is asked for advice whenever
|
||||
there is more than one approach to fix an inconsistency.
|
||||
|
||||
@ -9,13 +9,13 @@
|
||||
.B \-A
|
||||
]
|
||||
[
|
||||
.B \-b
|
||||
.B \-b
|
||||
.I sector-of-backup
|
||||
]
|
||||
[
|
||||
.B \-c
|
||||
]
|
||||
[
|
||||
[
|
||||
.B \-l
|
||||
.I filename
|
||||
]
|
||||
@ -52,7 +52,7 @@
|
||||
.I root-dir-entries
|
||||
]
|
||||
[
|
||||
.B \-R
|
||||
.B \-R
|
||||
.I number-of-reserved-sectors
|
||||
]
|
||||
[
|
||||
@ -161,7 +161,7 @@ Sets the message the user receives on attempts to boot this file system
|
||||
without having properly installed an operating system. The message
|
||||
file must not exceed 418 bytes once line feeds have been converted to
|
||||
carriage return-line feed combinations, and tabs have been expanded.
|
||||
If the filename is a hyphen (-), the text is taken from standard input.
|
||||
If the filename is a hyphen (-), the text is taken from standard input.
|
||||
.TP
|
||||
.BI \-n " volume-name"
|
||||
Sets the volume name (label) of the file system. The volume name can
|
||||
@ -203,7 +203,7 @@ Dave Hudson - <dave@humbug.demon.co.uk>; modified by Peter Anvin
|
||||
is based on code from
|
||||
.BR mke2fs
|
||||
(written by Remy Card - <card@masi.ibp.fr>) which is itself based on
|
||||
.BR mkfs
|
||||
.BR mkfs
|
||||
(written by Linus Torvalds - <torvalds@cs.helsinki.fi>).
|
||||
.SH SEE ALSO
|
||||
.BR dosfsck (8),
|
||||
|
||||
10
src/boot.c
10
src/boot.c
@ -62,7 +62,7 @@ static char *get_media_descr( unsigned char media )
|
||||
static void dump_boot(DOS_FS *fs,struct boot_sector *b,unsigned lss)
|
||||
{
|
||||
unsigned short sectors;
|
||||
|
||||
|
||||
printf("Boot sector contents:\n");
|
||||
if (!atari_format) {
|
||||
char id[9];
|
||||
@ -148,7 +148,7 @@ static void check_backup_boot(DOS_FS *fs, struct boot_sector *b, int lss)
|
||||
}
|
||||
else return;
|
||||
}
|
||||
|
||||
|
||||
fs_read(fs->backupboot_start,sizeof(b2),&b2);
|
||||
if (memcmp(b,&b2,sizeof(b2)) != 0) {
|
||||
/* there are any differences */
|
||||
@ -233,10 +233,10 @@ static void read_fsinfo(DOS_FS *fs, struct boot_sector *b,int lss)
|
||||
}
|
||||
else return;
|
||||
}
|
||||
|
||||
|
||||
fs->fsinfo_start = CF_LE_W(b->info_sector)*lss;
|
||||
fs_read(fs->fsinfo_start,sizeof(i),&i);
|
||||
|
||||
|
||||
if (i.magic != CT_LE_L(0x41615252) ||
|
||||
i.signature != CT_LE_L(0x61417272) ||
|
||||
i.boot_sign != CT_LE_W(0xaa55)) {
|
||||
@ -322,7 +322,7 @@ void read_boot(DOS_FS *fs)
|
||||
|
||||
fs->backupboot_start = CF_LE_W(b.backup_boot)*logical_sector_size;
|
||||
check_backup_boot(fs,&b,logical_sector_size);
|
||||
|
||||
|
||||
read_fsinfo(fs,&b,logical_sector_size);
|
||||
}
|
||||
else if (!atari_format) {
|
||||
|
||||
10
src/check.c
10
src/check.c
@ -69,7 +69,7 @@ loff_t alloc_rootdir_entry(DOS_FS *fs, DIR_ENT *de, const char *pattern)
|
||||
int i = 0, got = 0;
|
||||
unsigned long clu_num, prev = 0;
|
||||
loff_t offset2;
|
||||
|
||||
|
||||
clu_num = fs->root_cluster;
|
||||
offset = cluster_start(fs,clu_num);
|
||||
while (clu_num > 0 && clu_num != -1) {
|
||||
@ -226,7 +226,7 @@ static int bad_name(unsigned char *name)
|
||||
* of OS/2. */
|
||||
if (strncmp(name,"EA DATA SF",11) == 0 ||
|
||||
strncmp(name,"WP ROOT SF",11) == 0) return 0;
|
||||
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (name[i] < ' ' || name[i] == 0x7f) return 1;
|
||||
if (name[i] > 0x7f) ++suspicious;
|
||||
@ -262,7 +262,7 @@ static int bad_name(unsigned char *name)
|
||||
/* Under GEMDOS, chars >= 128 are never allowed. */
|
||||
if (atari_format && suspicious)
|
||||
return 1;
|
||||
|
||||
|
||||
/* Only complain about too much suspicious chars in interactive mode,
|
||||
* never correct them automatically. The chars are all basically ok, so we
|
||||
* shouldn't auto-correct such names. */
|
||||
@ -288,7 +288,7 @@ static void truncate_file(DOS_FS *fs,DOS_FILE *file,unsigned long clusters)
|
||||
{
|
||||
int deleting;
|
||||
unsigned long walk,next,prev;
|
||||
|
||||
|
||||
walk = FSTART(file,fs);
|
||||
prev = 0;
|
||||
if ((deleting = !clusters)) MODIFY_START(file,0,fs);
|
||||
@ -735,7 +735,7 @@ static void undelete(DOS_FS *fs,DOS_FILE *file)
|
||||
if (left)
|
||||
printf("Warning: Did only undelete %lu of %lu cluster%s.\n",clusters-left,
|
||||
clusters,clusters == 1 ? "" : "s");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ int main(int argc,char **argv)
|
||||
int rw,salvage_files,verify,c;
|
||||
unsigned n_files_check=0, n_files_verify=0;
|
||||
unsigned long free_clusters;
|
||||
|
||||
|
||||
rw = salvage_files = verify = 0;
|
||||
interactive = 1;
|
||||
check_atari();
|
||||
|
||||
@ -57,7 +57,7 @@ struct boot_sector {
|
||||
__u16 heads; /* number of heads */
|
||||
__u32 hidden; /* hidden sectors (unused) */
|
||||
__u32 total_sect; /* number of sectors (if sectors == 0) */
|
||||
|
||||
|
||||
/* The following fields are only used by FAT32 */
|
||||
__u32 fat32_length; /* sectors/FAT */
|
||||
__u16 flags; /* bit 8: fat mirroring, low 4: active fat */
|
||||
|
||||
2
src/io.c
2
src/io.c
@ -57,7 +57,7 @@ static loff_t llseek( int fd, loff_t offset, int whence )
|
||||
void fs_open(char *path,int rw)
|
||||
{
|
||||
struct stat stbuf;
|
||||
|
||||
|
||||
if ((fd = open(path,rw ? O_RDWR : O_RDONLY)) < 0)
|
||||
pdie("open %s",path);
|
||||
changes = last = NULL;
|
||||
|
||||
@ -61,7 +61,7 @@ static unsigned char fat_uni2esc[64] = {
|
||||
copy_lfn_part( __part_uni, lfn ); \
|
||||
cnv_unicode( __part_uni, CHARS_PER_LFN, 0 ); \
|
||||
})
|
||||
|
||||
|
||||
/* Convert name parts collected so far (from previous slots) from unicode to
|
||||
* ASCII */
|
||||
#define CNV_PARTS_SO_FAR() \
|
||||
@ -76,7 +76,7 @@ static char *cnv_unicode( const unsigned char *uni, int maxlen, int use_q )
|
||||
const unsigned char *up;
|
||||
unsigned char *out, *cp;
|
||||
int len, val;
|
||||
|
||||
|
||||
for( len = 0, up = uni; (up-uni)/2 < maxlen && (up[0] || up[1]); up += 2 ){
|
||||
if (UNICODE_CONVERTABLE(up[0],up[1]))
|
||||
++len;
|
||||
@ -125,7 +125,7 @@ static void clear_lfn_slots( int start, int end )
|
||||
*/
|
||||
memset( &empty, 0, sizeof(empty) );
|
||||
empty.id = DELETED_FLAG;
|
||||
|
||||
|
||||
for( i = start; i <= end; ++i ) {
|
||||
fs_write( lfn_offsets[i], sizeof(LFN_ENT), &empty );
|
||||
}
|
||||
@ -362,7 +362,7 @@ char *lfn_get( DIR_ENT *de )
|
||||
char *lfn;
|
||||
__u8 sum;
|
||||
int i;
|
||||
|
||||
|
||||
if (de->attr == VFAT_LN_ATTR)
|
||||
die("lfn_get called with LFN directory entry");
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
- New options -A, -S, -C
|
||||
- Support for filesystems > 2GB
|
||||
- FAT32 support
|
||||
|
||||
|
||||
Copying: Copyright 1993, 1994 David Hudson (dave@humbug.demon.co.uk)
|
||||
|
||||
Portions copyright 1992, 1993 Remy Card (card@masi.ibp.fr)
|
||||
@ -85,7 +85,7 @@
|
||||
#define CT_LE_W(v) CF_LE_W(v)
|
||||
#define CT_LE_L(v) CF_LE_L(v)
|
||||
#endif /* defined(__le16_to_cpu) */
|
||||
|
||||
|
||||
#else
|
||||
|
||||
#define CF_LE_W(v) (v)
|
||||
@ -604,7 +604,7 @@ establish_params (int device_num,int size)
|
||||
case 720:
|
||||
param.sect = 9 ;
|
||||
param.head = 2;
|
||||
break;
|
||||
break;
|
||||
case 1440:
|
||||
param.sect = 9;
|
||||
param.head = 2;
|
||||
@ -627,7 +627,7 @@ establish_params (int device_num,int size)
|
||||
param.head = 64;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else /* is a floppy diskette */
|
||||
{
|
||||
@ -658,7 +658,7 @@ establish_params (int device_num,int size)
|
||||
bs.dir_entries[0] = (char) 224;
|
||||
bs.dir_entries[1] = (char) 0;
|
||||
break;
|
||||
|
||||
|
||||
case 5760: /* 3.5", 2, 36, 80 - 2880K */
|
||||
bs.media = (char) 0xf0;
|
||||
bs.cluster_size = (char) 2;
|
||||
@ -683,7 +683,7 @@ establish_params (int device_num,int size)
|
||||
}
|
||||
else if ((device_num & 0xff00) == 0x0700) /* This is a loop device */
|
||||
{
|
||||
if (ioctl (dev, BLKGETSIZE, &loop_size))
|
||||
if (ioctl (dev, BLKGETSIZE, &loop_size))
|
||||
die ("unable to get loop device size");
|
||||
|
||||
switch (loop_size) /* Assuming the loop device -> floppy later */
|
||||
@ -714,7 +714,7 @@ establish_params (int device_num,int size)
|
||||
bs.dir_entries[0] = (char) 224;
|
||||
bs.dir_entries[1] = (char) 0;
|
||||
break;
|
||||
|
||||
|
||||
case 5760: /* 3.5", 2, 36, 80 - 2880K */
|
||||
bs.secs_track = CF_LE_W(36);
|
||||
bs.heads = CF_LE_W(2);
|
||||
@ -796,7 +796,7 @@ setup_tables (void)
|
||||
unsigned fatdata; /* Sectors for FATs + data area */
|
||||
struct tm *ctime;
|
||||
struct msdos_volume_info *vi = (size_fat == 32 ? &bs.fat32.vi : &bs.oldfat.vi);
|
||||
|
||||
|
||||
if (atari_format)
|
||||
/* On Atari, the first few bytes of the boot sector are assigned
|
||||
* differently: The jump code is only 2 bytes (and m68k machine code
|
||||
@ -836,7 +836,7 @@ setup_tables (void)
|
||||
|
||||
if (!atari_format) {
|
||||
memcpy(vi->volume_label, volume_name, 11);
|
||||
|
||||
|
||||
memcpy(bs.boot_jump, dummy_boot_jump, 3);
|
||||
/* Patch in the correct offset to the boot code */
|
||||
bs.boot_jump[1] = ((size_fat == 32 ?
|
||||
@ -892,7 +892,7 @@ setup_tables (void)
|
||||
unsigned maxclust12, maxclust16, maxclust32;
|
||||
unsigned clust12, clust16, clust32;
|
||||
int maxclustsize;
|
||||
|
||||
|
||||
fatdata = num_sectors - cdiv (root_dir_entries * 32, sector_size) -
|
||||
reserved_sectors;
|
||||
|
||||
@ -1040,14 +1040,14 @@ setup_tables (void)
|
||||
bs.fat32.fat32_length = CT_LE_L(fatlength32);
|
||||
memcpy(vi->fs_type, MSDOS_FAT32_SIGN, 8);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
die("FAT not 12, 16 or 32 bits");
|
||||
}
|
||||
}
|
||||
else {
|
||||
unsigned clusters, maxclust;
|
||||
|
||||
|
||||
/* GEMDOS always uses a 12 bit FAT on floppies, and always a 16 bit FAT on
|
||||
* hard disks. So use 12 bit if the size of the file system suggests that
|
||||
* this fs is for a floppy disk, if the user hasn't explicitly requested a
|
||||
@ -1093,7 +1093,7 @@ setup_tables (void)
|
||||
if (verbose >= 2)
|
||||
printf( "ss=%d: #clu=%d, fat_len=%d, maxclu=%d\n",
|
||||
sector_size, clusters, fat_length, maxclust );
|
||||
|
||||
|
||||
/* last 10 cluster numbers are special (except FAT32: 4 high bits rsvd);
|
||||
* first two numbers are reserved */
|
||||
if (maxclust <= (size_fat == 32 ? MAX_CLUST_32 : (1<<size_fat)-0x10) &&
|
||||
@ -1110,7 +1110,7 @@ setup_tables (void)
|
||||
num_sectors >>= 1;
|
||||
sector_size <<= 1;
|
||||
} while( sector_size <= GEMDOS_MAX_SECTOR_SIZE );
|
||||
|
||||
|
||||
if (sector_size > GEMDOS_MAX_SECTOR_SIZE)
|
||||
die( "Would need a sector size > 16k, which GEMDOS can't work with");
|
||||
|
||||
@ -1150,7 +1150,7 @@ setup_tables (void)
|
||||
bs.fat32.backup_boot = CT_LE_W(backup_boot);
|
||||
memset( &bs.fat32.reserved2, 0, sizeof(bs.fat32.reserved2) );
|
||||
}
|
||||
|
||||
|
||||
if (atari_format) {
|
||||
/* Just some consistency checks */
|
||||
if (num_sectors >= GEMDOS_MAX_SECTORS)
|
||||
@ -1184,7 +1184,7 @@ setup_tables (void)
|
||||
die ("Attempting to create a too large file system");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* The two following vars are in hard sectors, i.e. 512 byte sectors! */
|
||||
start_data_sector = (reserved_sectors + nr_fats * fat_length) *
|
||||
(sector_size/HARD_SECTOR_SIZE);
|
||||
@ -1198,7 +1198,7 @@ setup_tables (void)
|
||||
{
|
||||
printf("%s has %d head%s and %d sector%s per track,\n",
|
||||
device_name, CF_LE_W(bs.heads), (CF_LE_W(bs.heads) != 1) ? "s" : "",
|
||||
CF_LE_W(bs.secs_track), (CF_LE_W(bs.secs_track) != 1) ? "s" : "");
|
||||
CF_LE_W(bs.secs_track), (CF_LE_W(bs.secs_track) != 1) ? "s" : "");
|
||||
printf("logical sector size is %d,\n",sector_size);
|
||||
printf("using 0x%02x media descriptor, with %d sectors;\n",
|
||||
(int) (bs.media), num_sectors);
|
||||
@ -1270,7 +1270,7 @@ setup_tables (void)
|
||||
if (size_fat == 32) {
|
||||
/* For FAT32, create an info sector */
|
||||
struct fat32_fsinfo *info;
|
||||
|
||||
|
||||
if (!(info_sector = malloc( sector_size )))
|
||||
die("Out of memory");
|
||||
memset(info_sector, 0, sector_size);
|
||||
@ -1292,7 +1292,7 @@ setup_tables (void)
|
||||
/* Info sector also must have boot sign */
|
||||
*(__u16 *)(info_sector + 0x1fe) = CT_LE_W(BOOT_SIGN);
|
||||
}
|
||||
|
||||
|
||||
if (!(blank_sector = malloc( sector_size )))
|
||||
die( "Out of memory" );
|
||||
memset(blank_sector, 0, sector_size);
|
||||
@ -1423,7 +1423,7 @@ main (int argc, char **argv)
|
||||
int create = 0;
|
||||
unsigned long long cblocks;
|
||||
int min_sector_size;
|
||||
|
||||
|
||||
if (argc && *argv) { /* What's the program name? */
|
||||
char *p;
|
||||
program_name = *argv;
|
||||
@ -1434,7 +1434,7 @@ main (int argc, char **argv)
|
||||
time(&create_time);
|
||||
volume_id = (long)create_time; /* Default volume ID = creation time */
|
||||
check_atari();
|
||||
|
||||
|
||||
printf ("%s " VERSION " (" VERSION_DATE ")\n",
|
||||
program_name);
|
||||
|
||||
@ -1454,7 +1454,7 @@ main (int argc, char **argv)
|
||||
usage ();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'c': /* c : Check FS as we build it */
|
||||
check = TRUE;
|
||||
break;
|
||||
@ -1566,10 +1566,10 @@ main (int argc, char **argv)
|
||||
while( i < BOOTCODE_SIZE-1 )
|
||||
dummy_boot_code[i++] = '\0';
|
||||
dummy_boot_code[BOOTCODE_SIZE-1] = '\0'; /* Just in case */
|
||||
|
||||
|
||||
if ( ch != EOF )
|
||||
printf ("Warning: message too long; truncated\n");
|
||||
|
||||
|
||||
if ( msgfile != stdin )
|
||||
fclose(msgfile);
|
||||
}
|
||||
@ -1596,7 +1596,7 @@ main (int argc, char **argv)
|
||||
usage ();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 's': /* s : Sectors per cluster */
|
||||
sectors_per_cluster = (int) strtol (optarg, &tmp, 0);
|
||||
if (*tmp || (sectors_per_cluster != 1 && sectors_per_cluster != 2
|
||||
@ -1625,7 +1625,7 @@ main (int argc, char **argv)
|
||||
case 'v': /* v : Verbose execution */
|
||||
++verbose;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
printf( "Unknown option: %c\n", c );
|
||||
usage ();
|
||||
@ -1694,7 +1694,7 @@ main (int argc, char **argv)
|
||||
if (llseek( dev, 0, SEEK_SET ) != 0)
|
||||
die( "seek failed" );
|
||||
}
|
||||
|
||||
|
||||
if (fstat (dev, &statbuf) < 0)
|
||||
die ("unable to stat %s");
|
||||
if (!S_ISBLK (statbuf.st_mode)) {
|
||||
@ -1736,11 +1736,11 @@ main (int argc, char **argv)
|
||||
}
|
||||
|
||||
if (sector_size > 4096)
|
||||
fprintf(stderr,
|
||||
fprintf(stderr,
|
||||
"Warning: sector size is set to %d > 4096, such filesystem will not propably mount\n",
|
||||
sector_size);
|
||||
|
||||
establish_params (statbuf.st_rdev,statbuf.st_size);
|
||||
establish_params (statbuf.st_rdev,statbuf.st_size);
|
||||
/* Establish the media parameters */
|
||||
|
||||
setup_tables (); /* Establish the file system tables */
|
||||
|
||||
@ -5,4 +5,3 @@
|
||||
#define VERSION_DATE "12 Mar 2005"
|
||||
|
||||
#endif /* _version_h */
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user