[PATCH] typo: "formated" -> "formatted"

Robert P. J. Day rpjday at mindspring.com
Thu Apr 13 12:43:24 UTC 2006


  numerous instances, a couple in include/usage.h, the rest in
archival/libunarchive.  i don't *think* this will break anything.

rday
-------------- next part --------------
diff -pru busybox/archival/libunarchive/check_header_gzip.c busybox.new/archival/libunarchive/check_header_gzip.c
--- busybox/archival/libunarchive/check_header_gzip.c	2006-04-10 07:16:00.000000000 -0400
+++ busybox.new/archival/libunarchive/check_header_gzip.c	2006-04-13 08:41:09.000000000 -0400
@@ -13,18 +13,18 @@ void check_header_gzip(int src_fd)
 			unsigned int mtime;
 			unsigned char xtra_flags;
 			unsigned char os_flags;
-		} formated;
+		} formatted;
 	} header;
 
 	bb_xread_all(src_fd, header.raw, 8);
 
 	/* Check the compression method */
-	if (header.formated.method != 8) {
+	if (header.formatted.method != 8) {
 		bb_error_msg_and_die("Unknown compression method %d",
-						  header.formated.method);
+						  header.formatted.method);
 	}
 
-	if (header.formated.flags & 0x04) {
+	if (header.formatted.flags & 0x04) {
 		/* bit 2 set: extra field present */
 		unsigned char extra_short;
 
@@ -37,19 +37,19 @@ void check_header_gzip(int src_fd)
 	}
 
 	/* Discard original name if any */
-	if (header.formated.flags & 0x08) {
+	if (header.formatted.flags & 0x08) {
 		/* bit 3 set: original file name present */
 		while(bb_xread_char(src_fd) != 0);
 	}
 
 	/* Discard file comment if any */
-	if (header.formated.flags & 0x10) {
+	if (header.formatted.flags & 0x10) {
 		/* bit 4 set: file comment present */
 		while(bb_xread_char(src_fd) != 0);
 	}
 
 	/* Read the header checksum */
-	if (header.formated.flags & 0x02) {
+	if (header.formatted.flags & 0x02) {
 		bb_xread_char(src_fd);
 		bb_xread_char(src_fd);
 	}
diff -pru busybox/archival/libunarchive/get_header_ar.c busybox.new/archival/libunarchive/get_header_ar.c
--- busybox/archival/libunarchive/get_header_ar.c	2006-04-10 07:16:00.000000000 -0400
+++ busybox.new/archival/libunarchive/get_header_ar.c	2006-04-13 08:41:19.000000000 -0400
@@ -34,7 +34,7 @@ char get_header_ar(archive_handle_t *arc
 			char mode[8];
 			char size[10];
 			char magic[2];
-		} formated;
+		} formatted;
 	} ar;
 #ifdef CONFIG_FEATURE_AR_LONG_FILENAMES
 	static char *ar_long_names;
@@ -59,20 +59,20 @@ char get_header_ar(archive_handle_t *arc
 	archive_handle->offset += 60;
 
 	/* align the headers based on the header magic */
-	if ((ar.formated.magic[0] != '`') || (ar.formated.magic[1] != '\n')) {
+	if ((ar.formatted.magic[0] != '`') || (ar.formatted.magic[1] != '\n')) {
 		bb_error_msg_and_die("Invalid ar header");
 	}
 
-	typed->mode = strtol(ar.formated.mode, NULL, 8);
-	typed->mtime = atoi(ar.formated.date);
-	typed->uid = atoi(ar.formated.uid);
-	typed->gid = atoi(ar.formated.gid);
-	typed->size = atoi(ar.formated.size);
+	typed->mode = strtol(ar.formatted.mode, NULL, 8);
+	typed->mtime = atoi(ar.formatted.date);
+	typed->uid = atoi(ar.formatted.uid);
+	typed->gid = atoi(ar.formatted.gid);
+	typed->size = atoi(ar.formatted.size);
 
 	/* long filenames have '/' as the first character */
-	if (ar.formated.name[0] == '/') {
+	if (ar.formatted.name[0] == '/') {
 #ifdef CONFIG_FEATURE_AR_LONG_FILENAMES
-		if (ar.formated.name[1] == '/') {
+		if (ar.formatted.name[1] == '/') {
 			/* If the second char is a '/' then this entries data section
 			 * stores long filename for multiple entries, they are stored
 			 * in static variable long_names for use in future entries */
@@ -83,7 +83,7 @@ char get_header_ar(archive_handle_t *arc
 			/* This ar entries data section only contained filenames for other records
 			 * they are stored in the static ar_long_names for future reference */
 			return (get_header_ar(archive_handle)); /* Return next header */
-		} else if (ar.formated.name[1] == ' ') {
+		} else if (ar.formatted.name[1] == ' ') {
 			/* This is the index of symbols in the file for compilers */
 			data_skip(archive_handle);
 			archive_handle->offset += typed->size;
@@ -91,7 +91,7 @@ char get_header_ar(archive_handle_t *arc
 		} else {
 			/* The number after the '/' indicates the offset in the ar data section
 			(saved in variable long_name) that conatains the real filename */
-			const unsigned int long_offset = atoi(&ar.formated.name[1]);
+			const unsigned int long_offset = atoi(&ar.formatted.name[1]);
 			if (long_offset >= ar_long_name_size) {
 				bb_error_msg_and_die("Cant resolve long filename");
 			}
@@ -102,7 +102,7 @@ char get_header_ar(archive_handle_t *arc
 #endif
 	} else {
 		/* short filenames */
-	       typed->name = bb_xstrndup(ar.formated.name, 16);
+	       typed->name = bb_xstrndup(ar.formatted.name, 16);
 	}
 
 	typed->name[strcspn(typed->name, " /")] = '\0';
diff -pru busybox/archival/libunarchive/get_header_tar.c busybox.new/archival/libunarchive/get_header_tar.c
--- busybox/archival/libunarchive/get_header_tar.c	2006-04-10 07:16:00.000000000 -0400
+++ busybox.new/archival/libunarchive/get_header_tar.c	2006-04-13 08:41:29.000000000 -0400
@@ -46,7 +46,7 @@ char get_header_tar(archive_handle_t *ar
 			char devminor[8];	/* 337-344 */
 			char prefix[155];	/* 345-499 */
 			char padding[12];	/* 500-512 */
-		} formated;
+		} formatted;
 	} tar;
 	long sum = 0;
 	long i;
@@ -63,7 +63,7 @@ char get_header_tar(archive_handle_t *ar
 	archive_handle->offset += 512;
 
 	/* If there is no filename its an empty header */
-	if (tar.formated.name[0] == 0) {
+	if (tar.formatted.name[0] == 0) {
 		if (end) {
 			/* This is the second consecutive empty header! End of archive!
 			 * Read until the end to empty the pipe from gz or bz2
@@ -79,9 +79,9 @@ char get_header_tar(archive_handle_t *ar
 	/* Check header has valid magic, "ustar" is for the proper tar
 	 * 0's are for the old tar format
 	 */
-	if (strncmp(tar.formated.magic, "ustar", 5) != 0) {
+	if (strncmp(tar.formatted.magic, "ustar", 5) != 0) {
 #ifdef CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY
-		if (strncmp(tar.formated.magic, "\0\0\0\0\0", 5) != 0)
+		if (strncmp(tar.formatted.magic, "\0\0\0\0\0", 5) != 0)
 #endif
 			bb_error_msg_and_die("Invalid tar magic");
 	}
@@ -93,7 +93,7 @@ char get_header_tar(archive_handle_t *ar
 	for (i =  156; i < 512 ; i++) {
 		sum += tar.raw[i];
 	}
-	if (sum != strtol(tar.formated.chksum, NULL, 8)) {
+	if (sum != strtol(tar.formatted.chksum, NULL, 8)) {
 		bb_error_msg("Invalid tar header checksum");
 		return(EXIT_FAILURE);
 	}
@@ -109,29 +109,29 @@ char get_header_tar(archive_handle_t *ar
 	} else
 #endif
 	{
-		file_header->name = bb_xstrndup(tar.formated.name,100);
+		file_header->name = bb_xstrndup(tar.formatted.name,100);
 
-		if (tar.formated.prefix[0]) {
+		if (tar.formatted.prefix[0]) {
 			char *temp = file_header->name;
-			file_header->name = concat_path_file(tar.formated.prefix, temp);
+			file_header->name = concat_path_file(tar.formatted.prefix, temp);
 			free(temp);
 		}
 	}
 
-	file_header->uid = strtol(tar.formated.uid, NULL, 8);
-	file_header->gid = strtol(tar.formated.gid, NULL, 8);
-	file_header->size = strtol(tar.formated.size, NULL, 8);
-	file_header->mtime = strtol(tar.formated.mtime, NULL, 8);
-	file_header->link_name = (tar.formated.linkname[0] != '\0') ?
-	    bb_xstrdup(tar.formated.linkname) : NULL;
-	file_header->device = makedev(strtol(tar.formated.devmajor, NULL, 8),
-		strtol(tar.formated.devminor, NULL, 8));
+	file_header->uid = strtol(tar.formatted.uid, NULL, 8);
+	file_header->gid = strtol(tar.formatted.gid, NULL, 8);
+	file_header->size = strtol(tar.formatted.size, NULL, 8);
+	file_header->mtime = strtol(tar.formatted.mtime, NULL, 8);
+	file_header->link_name = (tar.formatted.linkname[0] != '\0') ?
+	    bb_xstrdup(tar.formatted.linkname) : NULL;
+	file_header->device = makedev(strtol(tar.formatted.devmajor, NULL, 8),
+		strtol(tar.formatted.devminor, NULL, 8));
 
 	/* Set bits 0-11 of the files mode */
-	file_header->mode = 07777 & strtol(tar.formated.mode, NULL, 8);
+	file_header->mode = 07777 & strtol(tar.formatted.mode, NULL, 8);
 
 	/* Set bits 12-15 of the files mode */
-	switch (tar.formated.typeflag) {
+	switch (tar.formatted.typeflag) {
 	/* busybox identifies hard links as being regular files with 0 size and a link name */
 	case '1':
 		file_header->mode |= S_IFREG;
@@ -189,10 +189,10 @@ char get_header_tar(archive_handle_t *ar
 	case 'N':	/* Old GNU for names > 100 characters */
 	case 'S':	/* Sparse file */
 	case 'V':	/* Volume header */
-		bb_error_msg("Ignoring GNU extension type %c", tar.formated.typeflag);
+		bb_error_msg("Ignoring GNU extension type %c", tar.formatted.typeflag);
 #endif
 	default:
-		bb_error_msg("Unknown typeflag: 0x%x", tar.formated.typeflag);
+		bb_error_msg("Unknown typeflag: 0x%x", tar.formatted.typeflag);
 	}
 	{	/* Strip trailing '/' in directories */
 		/* Must be done after mode is set as '/' is used to check if its a directory */
diff -pru busybox/archival/unzip.c busybox.new/archival/unzip.c
--- busybox/archival/unzip.c	2006-04-12 16:17:52.000000000 -0400
+++ busybox.new/archival/unzip.c	2006-04-13 08:40:28.000000000 -0400
@@ -71,7 +71,7 @@ typedef union {
 		unsigned int ucmpsize ATTRIBUTE_PACKED;	/* 18-21 */
 		unsigned short filename_len;	/* 22-23 */
 		unsigned short extra_len;		/* 24-25 */
-	} formated ATTRIBUTE_PACKED;
+	} formatted ATTRIBUTE_PACKED;
 } zip_header_t;
 
 static void unzip_skip(int fd, off_t skip)
@@ -102,25 +102,25 @@ static void unzip_create_leading_dirs(ch
 
 static int unzip_extract(zip_header_t *zip_header, int src_fd, int dst_fd)
 {
-	if (zip_header->formated.method == 0) {
+	if (zip_header->formatted.method == 0) {
 		/* Method 0 - stored (not compressed) */
-		int size = zip_header->formated.ucmpsize;
+		int size = zip_header->formatted.ucmpsize;
 		if (size && (bb_copyfd_size(src_fd, dst_fd, size) != size)) {
 			bb_error_msg_and_die("Cannot complete extraction");
 		}
 
 	} else {
 		/* Method 8 - inflate */
-		inflate_init(zip_header->formated.cmpsize);
+		inflate_init(zip_header->formatted.cmpsize);
 		inflate_unzip(src_fd, dst_fd);
 		inflate_cleanup();
 		/* Validate decompression - crc */
-		if (zip_header->formated.crc32 != (gunzip_crc ^ 0xffffffffL)) {
+		if (zip_header->formatted.crc32 != (gunzip_crc ^ 0xffffffffL)) {
 			bb_error_msg("Invalid compressed data--crc error");
 			return 1;
 		}
 		/* Validate decompression - size */
-		if (zip_header->formated.ucmpsize != gunzip_bytes_out) {
+		if (zip_header->formatted.ucmpsize != gunzip_bytes_out) {
 			bb_error_msg("Invalid compressed data--length error");
 			return 1;
 		}
@@ -258,29 +258,29 @@ int unzip_main(int argc, char **argv)
 		/* Read the file header */
 		unzip_read(src_fd, zip_header.raw, 26);
 #if BB_BIG_ENDIAN
-		zip_header.formated.version = __swap16(zip_header.formated.version);
-		zip_header.formated.flags = __swap16(zip_header.formated.flags);
-		zip_header.formated.method = __swap16(zip_header.formated.method);
-		zip_header.formated.modtime = __swap16(zip_header.formated.modtime);
-		zip_header.formated.moddate = __swap16(zip_header.formated.moddate);
-		zip_header.formated.crc32 = __swap32(zip_header.formated.crc32);
-		zip_header.formated.cmpsize = __swap32(zip_header.formated.cmpsize);
-		zip_header.formated.ucmpsize = __swap32(zip_header.formated.ucmpsize);
-		zip_header.formated.filename_len = __swap16(zip_header.formated.filename_len);
-		zip_header.formated.extra_len = __swap16(zip_header.formated.extra_len);
+		zip_header.formatted.version = __swap16(zip_header.formatted.version);
+		zip_header.formatted.flags = __swap16(zip_header.formatted.flags);
+		zip_header.formatted.method = __swap16(zip_header.formatted.method);
+		zip_header.formatted.modtime = __swap16(zip_header.formatted.modtime);
+		zip_header.formatted.moddate = __swap16(zip_header.formatted.moddate);
+		zip_header.formatted.crc32 = __swap32(zip_header.formatted.crc32);
+		zip_header.formatted.cmpsize = __swap32(zip_header.formatted.cmpsize);
+		zip_header.formatted.ucmpsize = __swap32(zip_header.formatted.ucmpsize);
+		zip_header.formatted.filename_len = __swap16(zip_header.formatted.filename_len);
+		zip_header.formatted.extra_len = __swap16(zip_header.formatted.extra_len);
 #endif /* BB_BIG_ENDIAN */
-		if ((zip_header.formated.method != 0) && (zip_header.formated.method != 8)) {
-			bb_error_msg_and_die("Unsupported compression method %d", zip_header.formated.method);
+		if ((zip_header.formatted.method != 0) && (zip_header.formatted.method != 8)) {
+			bb_error_msg_and_die("Unsupported compression method %d", zip_header.formatted.method);
 		}
 
 		/* Read filename */
 		free(dst_fn);
-		dst_fn = xmalloc(zip_header.formated.filename_len + 1);
-		unzip_read(src_fd, dst_fn, zip_header.formated.filename_len);
-		dst_fn[zip_header.formated.filename_len] = 0;
+		dst_fn = xmalloc(zip_header.formatted.filename_len + 1);
+		unzip_read(src_fd, dst_fn, zip_header.formatted.filename_len);
+		dst_fn[zip_header.formatted.filename_len] = 0;
 
 		/* Skip extra header bytes */
-		unzip_skip(src_fd, zip_header.formated.extra_len);
+		unzip_skip(src_fd, zip_header.formatted.extra_len);
 
 		if ((verbosity == v_list) && !list_header_done){
 			printf("  Length     Date   Time    Name\n");
@@ -294,12 +294,12 @@ int unzip_main(int argc, char **argv)
 			i = 'n';
 
 		} else { /* Extract entry */
-			total_size += zip_header.formated.ucmpsize;
+			total_size += zip_header.formatted.ucmpsize;
 
 			if (verbosity == v_list) { /* List entry */
-				unsigned int dostime = zip_header.formated.modtime | (zip_header.formated.moddate << 16);
+				unsigned int dostime = zip_header.formatted.modtime | (zip_header.formatted.moddate << 16);
 				printf("%9u  %02u-%02u-%02u %02u:%02u   %s\n",
-					   zip_header.formated.ucmpsize,
+					   zip_header.formatted.ucmpsize,
 					   (dostime & 0x01e00000) >> 21,
 					   (dostime & 0x001f0000) >> 16,
 					   (((dostime & 0xfe000000) >> 25) + 1980) % 100,
@@ -384,7 +384,7 @@ int unzip_main(int argc, char **argv)
 			overwrite = o_never;
 		case 'n':
 			/* Skip entry data */
-			unzip_skip(src_fd, zip_header.formated.cmpsize);
+			unzip_skip(src_fd, zip_header.formatted.cmpsize);
 			break;
 
 		case 'r':
@@ -404,7 +404,7 @@ int unzip_main(int argc, char **argv)
 		}
 
 		/* Data descriptor section */
-		if (zip_header.formated.flags & 4) {
+		if (zip_header.formatted.flags & 4) {
 			/* skip over duplicate crc, compressed size and uncompressed size */
 			unzip_skip(src_fd, 12);
 		}
diff -pru busybox/include/usage.h busybox.new/include/usage.h
--- busybox/include/usage.h	2006-04-10 07:16:14.000000000 -0400
+++ busybox.new/include/usage.h	2006-04-13 08:39:24.000000000 -0400
@@ -1898,7 +1898,7 @@
 	"\t-c\tcheck MD5 sums against given list\n" \
 	"\nThe following two options are useful only when verifying checksums:\n" \
 	"\t-s\tdon't output anything, status code shows success\n" \
-	"\t-w\twarn about improperly formated MD5 checksum lines")
+	"\t-w\twarn about improperly formatted MD5 checksum lines")
 #define md5sum_example_usage \
 	"$ md5sum < busybox\n" \
 	"6fd11e98b98a58f64ff3398d7b324003\n" \
@@ -2710,7 +2710,7 @@
 	"\t-c\tcheck SHA1 sums against given list\n" \
 	"\nThe following two options are useful only when verifying checksums:\n" \
 	"\t-s\tdon't output anything, status code shows success\n" \
-	"\t-w\twarn about improperly formated SHA1 checksum lines")
+	"\t-w\twarn about improperly formatted SHA1 checksum lines")
 
 #ifdef CONFIG_FEATURE_FANCY_SLEEP
 #  define USAGE_FANCY_SLEEP(a) a


More information about the busybox mailing list