Larry Doolittle writes:

This is a bulk spelling fix patch against busybox-1.00-pre10.
If anyone gets a corrupted copy (and cares), let me know and
I will make alternate arrangements.

Erik - please apply.

Authors - please check that I didn't corrupt any meaning.

Package importers - see if any of these changes should be
passed to the upstream authors.

I glossed over lots of sloppy capitalizations, missing apostrophes,
mixed American/British spellings, and German-style compound words.

What is "pretect redefined for test" in cmdedit.c?

Good luck on the 1.00 release!

      - Larry
diff --git a/archival/dpkg.c b/archival/dpkg.c
index e192b4a..c096518 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -1,6 +1,6 @@
 /*
  *  Mini dpkg implementation for busybox.
- *  This is not meant as a replacemnt for dpkg
+ *  This is not meant as a replacement for dpkg
  *
  *  Written By Glenn McGrath with the help of others
  *  Copyright (C) 2001 by Glenn McGrath
@@ -23,7 +23,7 @@
  */
 
 /*
- * Known difference between busybox dpkg and the official dpkg that i dont
+ * Known difference between busybox dpkg and the official dpkg that i don't
  * consider important, its worth keeping a note of differences anyway, just to
  * make it easier to maintain.
  *  - The first value for the Confflile: field isnt placed on a new line.
@@ -86,7 +86,7 @@
 
 /* Currently it doesnt store packages that have state-status of not-installed
  * So it only really has to be the size of the maximum number of packages
- * likely to be installed at any one time, so there is a bit of leaway here */
+ * likely to be installed at any one time, so there is a bit of leeway here */
 #define STATUS_HASH_PRIME 8191
 typedef struct status_node_s {
 	unsigned int package:14;	/* has to fit PACKAGE_HASH_PRIME */
@@ -94,7 +94,7 @@
 } status_node_t;
 status_node_t *status_hashtable[STATUS_HASH_PRIME + 1];
 
-/* Even numbers are for 'extras', like ored dependecies or null */
+/* Even numbers are for 'extras', like ored dependencies or null */
 enum edge_type_e {
 	EDGE_NULL = 0,
 	EDGE_PRE_DEPENDS = 1,
@@ -148,7 +148,7 @@
 	for(i = 1; i < len; i++) {
 		/* shifts the ascii based value and adds it to previous value
 		 * shift amount is mod 24 because long int is 32 bit and data
-		 * to be shifted is 8, dont want to shift data to where it has
+		 * to be shifted is 8, don't want to shift data to where it has
 		 * no effect*/
 		hash_num += ((key[i] + key[i-1]) << ((key[i] * i) % 24));
 	}
@@ -392,7 +392,7 @@
 /*
  * This function searches through the entire package_hashtable looking
  * for a package which provides "needle". It returns the index into
- * the package_hashtable for the provining package.
+ * the package_hashtable for the providing package.
  *
  * needle is the index into name_hashtable of the package we are
  * looking for.
@@ -489,7 +489,7 @@
 				/* Skip leading ' ' or '(' */
 				version += strspn(field2, " ");
 				version += strspn(version, "(");
-				/* Calculate length of any operator charactors */
+				/* Calculate length of any operator characters */
 				offset_ch = strspn(version, "<=>");
 				/* Determine operator */
 				if (offset_ch > 0) {
@@ -636,7 +636,7 @@
 	for (i = 1; i < num; i++) {
 		/* skip past a word */
 		status_string += strcspn(status_string, " ");
-		/* skip past the seperating spaces */
+		/* skip past the separating spaces */
 		status_string += strspn(status_string, " ");
 	}
 	len = strcspn(status_string, " \n\0");
@@ -955,13 +955,13 @@
 	fclose(new_status_file);
 
 
-	/* Create a seperate backfile to dpkg */
+	/* Create a separate backfile to dpkg */
 	if (rename("/var/lib/dpkg/status", "/var/lib/dpkg/status.udeb.bak") == -1) {
 		struct stat stat_buf;
 		if (stat("/var/lib/dpkg/status", &stat_buf) == 0) {
 			bb_error_msg_and_die("Couldnt create backup status file");
 		}
-		/* Its ok if renaming the status file fails becasue status
+		/* Its ok if renaming the status file fails because status
 		 * file doesnt exist, maybe we are starting from scratch */
 		bb_error_msg("No status file found, creating new one");
 	}
@@ -971,10 +971,10 @@
 	}
 }
 
-/* This function returns TRUE if the given package can statisfy a
+/* This function returns TRUE if the given package can satisfy a
  * dependency of type depend_type.
  *
- * A pre-depends is statisfied only if a package is already installed,
+ * A pre-depends is satisfied only if a package is already installed,
  * which a regular depends can be satisfied by a package which we want
  * to install.
  */
@@ -1085,7 +1085,7 @@
 	for (i = 0; i < PACKAGE_HASH_PRIME; i++) {
 		int status_num = 0;
 		int number_of_alternatives = 0;
-		const edge_t * root_of_alternatives;
+		const edge_t * root_of_alternatives = NULL;
 		const common_node_t *package_node = package_hashtable[i];
 
 		/* If the package node does not exist then this
@@ -1118,7 +1118,7 @@
                         continue;
 #endif
 
-		/* This code is tested only for EDGE_DEPENDS, sine I
+		/* This code is tested only for EDGE_DEPENDS, since I
 		 * have no suitable pre-depends available. There is no
 		 * reason that it shouldn't work though :-)
 		 */
@@ -1211,7 +1211,7 @@
 	char *line = NULL;
 	int count = 0;
 
-	/* dont use [xw]fopen here, handle error ourself */
+	/* don't use [xw]fopen here, handle error ourself */
 	list_stream = fopen(filename, "r");
 	if (list_stream == NULL) {
 		return(NULL);
@@ -1385,7 +1385,7 @@
 		bb_error_msg_and_die("script failed, prerm failure");
 	}
 
-	/* Create a list of files to remove, and a seperate list of those to keep */
+	/* Create a list of files to remove, and a separate list of those to keep */
 	sprintf(list_name, "/var/lib/dpkg/info/%s.list", package_name);
 	remove_files = create_list(list_name);
 
@@ -1480,7 +1480,7 @@
 	tar_handle = init_handle();
 	tar_handle->src_fd = ar_handle->src_fd;
 
-	/* We dont care about data.tar.* or debian-binary, just control.tar.* */
+	/* We don't care about data.tar.* or debian-binary, just control.tar.* */
 #ifdef CONFIG_FEATURE_DEB_TAR_GZ
 	ar_handle->accept = llist_add_to(NULL, "control.tar.gz");
 #endif
@@ -1502,7 +1502,7 @@
 	tar_handle = init_handle();
 	tar_handle->src_fd = ar_handle->src_fd;
 
-	/* We dont care about control.tar.* or debian-binary, just data.tar.* */
+	/* We don't care about control.tar.* or debian-binary, just data.tar.* */
 #ifdef CONFIG_FEATURE_DEB_TAR_GZ
 	ar_handle->accept = llist_add_to(NULL, "data.tar.gz");
 #endif
diff --git a/archival/gzip.c b/archival/gzip.c
index 1708ac1..d494aa3 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -632,7 +632,7 @@
  *      However the F&G algorithm may be faster for some highly redundant
  *      files if the parameter max_chain_length (described below) is too large.
  *
- *  ACKNOWLEDGEMENTS
+ *  ACKNOWLEDGMENTS
  *
  *      The idea of lazy evaluation of matches is due to Jan-Mark Wams, and
  *      I found it in 'freeze' written by Leonid Broukhis.
diff --git a/archival/libunarchive/data_extract_all.c b/archival/libunarchive/data_extract_all.c
index a9a3a93..52edaa1 100644
--- a/archival/libunarchive/data_extract_all.c
+++ b/archival/libunarchive/data_extract_all.c
@@ -66,7 +66,7 @@
 		}
 	}
 
-	/* Handle hard links seperately
+	/* Handle hard links separately
 	 * We identified hard links as regular files of size 0 with a symlink */
 	if (S_ISREG(file_header->mode) && (file_header->link_name) && (file_header->size == 0)) {
 		/* hard link */
diff --git a/archival/libunarchive/decompress_bunzip2.c b/archival/libunarchive/decompress_bunzip2.c
index af16533..4b8ceb8 100644
--- a/archival/libunarchive/decompress_bunzip2.c
+++ b/archival/libunarchive/decompress_bunzip2.c
@@ -13,7 +13,7 @@
 /*
 	Size and speed optimizations by Manuel Novoa III  (mjn3@codepoet.org).
 
-	More efficient reading of huffman codes, a streamlined read_bunzip()
+	More efficient reading of Huffman codes, a streamlined read_bunzip()
 	function, and various other tweaks.  In (limited) tests, approximately
 	20% faster than bzcat on x86 and about 10% faster on arm.
 
@@ -49,10 +49,10 @@
 
 #include "libbb.h"
 
-/* Constants for huffman coding */
+/* Constants for Huffman coding */
 #define MAX_GROUPS			6
 #define GROUP_SIZE   		50		/* 64 would have been more efficient */
-#define MAX_HUFCODE_BITS 	20		/* Longest huffman code allowed */
+#define MAX_HUFCODE_BITS 	20		/* Longest Huffman code allowed */
 #define MAX_SYMBOLS 		258		/* 256 literals + RUNA + RUNB */
 #define SYMBOL_RUNA			0
 #define SYMBOL_RUNB			1
@@ -70,7 +70,7 @@
 /* Other housekeeping constants */
 #define IOBUF_SIZE			4096
 
-/* This is what we know about each huffman coding group */
+/* This is what we know about each Huffman coding group */
 struct group_data {
 	/* We have an extra slot at the end of limit[] for a sentinal value. */
 	int limit[MAX_HUFCODE_BITS+1],base[MAX_HUFCODE_BITS],permute[MAX_SYMBOLS];
@@ -92,7 +92,7 @@
 	unsigned int *dbuf, dbufSize;
 	/* These things are a bit too big to go on the stack */
 	unsigned char selectors[32768];			/* nSelectors=15 bits */
-	struct group_data groups[MAX_GROUPS];	/* huffman coding tables */
+	struct group_data groups[MAX_GROUPS];	/* Huffman coding tables */
 	/* For I/O error handling */
 	jmp_buf jmpbuf;
 } bunzip_data;
@@ -172,10 +172,10 @@
 				if(k&(1<<(15-j))) symToByte[symTotal++]=(16*i)+j;
 		}
 	}
-	/* How many different huffman coding groups does this block use? */
+	/* How many different Huffman coding groups does this block use? */
 	groupCount=get_bits(bd,3);
 	if (groupCount<2 || groupCount>MAX_GROUPS) return RETVAL_DATA_ERROR;
-	/* nSelectors: Every GROUP_SIZE many symbols we select a new huffman coding
+	/* nSelectors: Every GROUP_SIZE many symbols we select a new Huffman coding
 	   group.  Read in the group selector list, which is stored as MTF encoded
 	   bit runs.  (MTF=Move To Front, as each value is used it's moved to the
 	   start of the list.) */
@@ -189,13 +189,13 @@
 		for(;j;j--) mtfSymbol[j] = mtfSymbol[j-1];
 		mtfSymbol[0]=selectors[i]=uc;
 	}
-	/* Read the huffman coding tables for each group, which code for symTotal
+	/* Read the Huffman coding tables for each group, which code for symTotal
 	   literal symbols, plus two run symbols (RUNA, RUNB) */
 	symCount=symTotal+2;
 	for (j=0; j<groupCount; j++) {
 		unsigned char length[MAX_SYMBOLS],temp[MAX_HUFCODE_BITS+1];
 		int	minLen,	maxLen, pp;
-		/* Read huffman code lengths for each symbol.  They're stored in
+		/* Read Huffman code lengths for each symbol.  They're stored in
 		   a way similar to mtf; record a starting value for the first symbol,
 		   and an offset from the previous value for everys symbol after that.
 		   (Subtracting 1 before the loop and then adding it back at the end is
@@ -228,12 +228,12 @@
 		}
 		/* Calculate permute[], base[], and limit[] tables from length[].
 		 *
-		 * permute[] is the lookup table for converting huffman coded symbols
+		 * permute[] is the lookup table for converting Huffman coded symbols
 		 * into decoded symbols.  base[] is the amount to subtract from the
-		 * value of a huffman symbol of a given length when using permute[].
+		 * value of a Huffman symbol of a given length when using permute[].
 		 *
 		 * limit[] indicates the largest numerical value a symbol with a given
-		 * number of bits can have.  This is how the huffman codes can vary in
+		 * number of bits can have.  This is how the Huffman codes can vary in
 		 * length: each code with a value>limit[length] needs another bit.
 		 */
 		hufGroup=bd->groups+j;
@@ -275,7 +275,7 @@
 		base[minLen]=0;
 	}
 	/* We've finished reading and digesting the block header.  Now read this
-	   block's huffman coded symbols from the file and undo the huffman coding
+	   block's Huffman coded symbols from the file and undo the Huffman coding
 	   and run length encoding, saving the result into dbuf[dbufCount++]=uc */
 
 	/* Initialize symbol occurrence counters and symbol Move To Front table */
@@ -286,7 +286,7 @@
 	/* Loop through compressed symbols. */
 	runPos=dbufCount=symCount=selector=0;
 	for(;;) {
-		/* Determine which huffman coding group to use. */
+		/* Determine which Huffman coding group to use. */
 		if(!(symCount--)) {
 			symCount=GROUP_SIZE-1;
 			if(selector>=nSelectors) return RETVAL_DATA_ERROR;
@@ -294,7 +294,7 @@
 			base=hufGroup->base-1;
 			limit=hufGroup->limit-1;
 		}
-		/* Read next huffman-coded symbol. */
+		/* Read next Huffman-coded symbol. */
 		/* Note: It is far cheaper to read maxLen bits and back up than it is
 		   to read minLen bits and then an additional bit at a time, testing
 		   as we go.  Because there is a trailing last block (with file CRC),
@@ -383,7 +383,7 @@
 		byteCount[uc]++;
 		dbuf[dbufCount++] = (unsigned int)uc;
 	}
-	/* At this point, we've read all the huffman-coded symbols (and repeated
+	/* At this point, we've read all the Huffman-coded symbols (and repeated
        runs) for this block from the input stream, and decoded them into the
 	   intermediate buffer.  There are dbufCount many decoded bytes in dbuf[].
 	   Now undo the Burrows-Wheeler transform on dbuf.
@@ -439,7 +439,7 @@
 
 	/* We will always have pending decoded data to write into the output
 	   buffer unless this is the very first call (in which case we haven't
-	   huffman-decoded a block into the intermediate buffer yet). */
+	   Huffman-decoded a block into the intermediate buffer yet). */
 
 	if (bd->writeCopies) {
 		/* Inside the loop, writeCopies means extra copies (beyond 1) */
@@ -495,7 +495,7 @@
 		}
 	}
 
-	/* Refill the intermediate buffer by huffman-decoding next block of input */
+	/* Refill the intermediate buffer by Huffman-decoding next block of input */
 	/* (previous is just a convenient unused temp variable here) */
 	previous=get_next_block(bd);
 	if(previous) {
diff --git a/archival/libunarchive/decompress_uncompress.c b/archival/libunarchive/decompress_uncompress.c
index ddf293f..e39872c 100644
--- a/archival/libunarchive/decompress_uncompress.c
+++ b/archival/libunarchive/decompress_uncompress.c
@@ -30,7 +30,7 @@
 #include <string.h>
 #include <unistd.h>
 
-/* Defailt input buffer size */
+/* Default input buffer size */
 #define	IBUFSIZ	2048
 
 /* Default output buffer size */
diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c
index a436db1..35fcfee 100644
--- a/archival/libunarchive/decompress_unzip.c
+++ b/archival/libunarchive/decompress_unzip.c
@@ -892,7 +892,7 @@
 	/* Doesnt get here */
 }
 
-/* Initialise bytebuffer, be carefull not to overfill the buffer */
+/* Initialise bytebuffer, be careful not to overfill the buffer */
 extern void inflate_init(unsigned int bufsize)
 {
 	/* Set the bytebuffer size, default is same as gunzip_wsize */
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c
index c6ebdae..33f19c6 100644
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -14,7 +14,7 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
  *  FIXME:
- *    In privelidged mode if uname and gname map to a uid amd gid then use the
+ *    In privileged mode if uname and gname map to a uid and gid then use the
  *    mapped value instead of the uid/gid values in tar header
  *
  *  References:
diff --git a/archival/tar.c b/archival/tar.c
index 279cbfd..8d2ccca 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -2,11 +2,11 @@
 /*
  * Mini tar implementation for busybox
  *
- * Modifed to use common extraction code used by ar, cpio, dpkg-deb, dpkg
+ * Modified to use common extraction code used by ar, cpio, dpkg-deb, dpkg
  *  Glenn McGrath <bug1@optushome.com.au>
  *
  * Note, that as of BusyBox-0.43, tar has been completely rewritten from the
- * ground up.  It still has remnents of the old code lying about, but it is
+ * ground up.  It still has remnants of the old code lying about, but it is
  * very different now (i.e., cleaner, less global variables, etc.)
  *
  * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
@@ -796,7 +796,7 @@
 	}
 
 	/* Setup an array of filenames to work with */
-	/* TODO: This is the same as in ar, seperate function ? */
+	/* TODO: This is the same as in ar, separate function ? */
 	while (optind < argc) {
 		char *filename_ptr = last_char_is(argv[optind], '/');
 		if (filename_ptr) {