1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

Fix comment spelling

This commit is contained in:
Joseph Crail 2016-11-25 14:36:56 -05:00
parent b3680a5baf
commit 78d2e8db27
20 changed files with 25 additions and 25 deletions

View file

@ -137,7 +137,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
}
pub trait StrUtils {
/// Remove comments and trim whitespaces
/// Remove comments and trim whitespace
fn purify(&self) -> &Self;
/// Like split_whitespace() but only produce 2 components
fn split_two(&self) -> (&str, &str);

2
src/env/env.rs vendored
View file

@ -63,7 +63,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
let mut item = iter.next();
// the for loop doesn't work here,
// because we need sometines to read 2 items forward,
// because we need sometimes to read 2 items forward,
// and the iter can't be borrowed twice
while item != None {
let opt = item.unwrap();

View file

@ -64,7 +64,7 @@ fn rho_pollard_find_divisor(num: u64) -> u64 {
y = rho_pollard_pseudorandom_function(y, a, b, num);
let d = gcd(num, max(x, y) - min(x, y));
if d == num {
// Failure, retry with diffrent function
// Failure, retry with different function
x = range.ind_sample(&mut rng);
y = x;
a = range.ind_sample(&mut rng);

View file

@ -332,7 +332,7 @@ impl<'a> Iterator for ParagraphStream<'a> {
// in tagged mode, add 4 spaces of additional indenting by default
// (gnu fmt's behavior is different: it seems to find the closest column to
// indent_end that is divisible by 3. But honesly that behavior seems
// indent_end that is divisible by 3. But honestly that behavior seems
// pretty arbitrary.
// Perhaps a better default would be 1 TABWIDTH? But ugh that's so big.
if self.opts.tagged {

View file

@ -94,7 +94,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
}
}
/// Build a specification of the comamnd line.
/// Build a specification of the command line.
///
/// Returns a getopts::Options struct.
///

View file

@ -29,7 +29,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
let mut opts = getopts::Options::new();
// Linux-specific options, not implemented
// opts.optflag("Z", "context", "set SELinux secutiry context" +
// opts.optflag("Z", "context", "set SELinux security context" +
// " of each created directory to CTX"),
opts.optopt("m", "mode", "set file mode", "755");
opts.optflag("p", "parents", "make parent directories as needed");

View file

@ -214,7 +214,7 @@ fn exec(tmpdir: PathBuf, prefix: &str, rand: usize, suffix: &str, make_dir: bool
println!("{}", tmpname);
// CAUTION: Not to call `drop` of tmpfile, which removes the tempfile,
// I call a dengeros function `forget`.
// I call a dangerous function `forget`.
forget(tmpfile);
0

View file

@ -52,7 +52,7 @@ pub struct Settings {
number_separator: String
}
// NumberingStyle stores which lines are to be numberd.
// NumberingStyle stores which lines are to be numbered.
// The possible options are:
// 1. Number all lines
// 2. Number only nonempty lines

View file

@ -13,7 +13,7 @@ pub struct InputDecoder<'a, I> where I: 'a {
/// A memory buffer, it's size is set in `new`.
data: Vec<u8>,
/// The numer of bytes in the buffer reserved for the peek data from `PeekRead`.
/// The number of bytes in the buffer reserved for the peek data from `PeekRead`.
reserved_peek_length: usize,
/// The number of (valid) bytes in the buffer.

View file

@ -427,7 +427,7 @@ fn print_bytes(prefix: &str, input_decoder: &MemoryDecoder, output_info: &Output
/// returns a reader implementing `PeekRead + Read + HasError` providing the combined input
///
/// `skip_bytes` is the number of bytes skipped from the input
/// `read_bytes` is an optinal limit to the number of bytes to read
/// `read_bytes` is an optional limit to the number of bytes to read
fn open_input_peek_reader<'a>(input_strings: &'a Vec<String>, skip_bytes: usize,
read_bytes: Option<usize>) -> PeekReader<PartialReader<MultifileReader<'a>>> {
// should return "impl PeekRead + Read + HasError" when supported in (stable) rust

View file

@ -92,7 +92,7 @@ impl OutputInfo {
/// ```
/// In this example is additional spacing before the first and third decimal number,
/// and there is additional spacing before the 1st, 3rd, 5th and 7th hexadecimal number.
/// This way both the octal and decimal, aswell the decimal and hexadecimal numbers
/// This way both the octal and decimal, as well as the decimal and hexadecimal numbers
/// left align. Note that the alignment below both octal numbers is identical.
///
/// This function calculates the required spacing for a single line, given the size
@ -110,7 +110,7 @@ impl OutputInfo {
/// If the blocksize is 8, and the size of the type is 2, the spacing will be
/// spread across position 0, 2, 4, 6. All 4 positions will get an additional
/// space as long as there are more then 4 spaces available. If there are 2
/// spaces available, they will be assigend to position 0 and 4. If there is
/// spaces available, they will be assigned to position 0 and 4. If there is
/// 1 space available, it will be assigned to position 0. This will be combined,
/// For example 7 spaces will be assigned to position 0, 2, 4, 6 like: 3, 1, 2, 1.
/// And 7 spaces with 2 positions will be assigned to position 0 and 4 like 4, 3.

View file

@ -317,7 +317,7 @@ pub fn parse_format_flags_str(args_str: &Vec<&'static str>) -> Result<Vec<Format
match parse_format_flags(&args) {
Err(e) => Err(e),
Ok(v) => {
// tests using this function asume add_ascii_dump is not set
// tests using this function assume add_ascii_dump is not set
Ok(v.into_iter()
.inspect(|f| assert!(!f.add_ascii_dump))
.map(|f| f.formatter_item_info)

View file

@ -39,7 +39,7 @@ fn format_flo16(f: f16) -> String {
}
// formats float with 8 significant digits, eg 12345678 or -1.2345678e+12
// always retuns a string of 14 characters
// always returns a string of 14 characters
fn format_flo32(f: f32) -> String {
let width: usize = 14;
let precision: usize = 8;

View file

@ -33,7 +33,7 @@ enum Mode {
static NAME: &'static str = "pathchk";
static VERSION: &'static str = env!("CARGO_PKG_VERSION");
// a few global constants as used in the GNU implememntation
// a few global constants as used in the GNU implementation
static POSIX_PATH_MAX: usize = 256;
static POSIX_NAME_MAX: usize = 14;
@ -207,7 +207,7 @@ fn check_searchable(path: &String) -> bool {
}
}
// check for a hypthen at the beginning of a path segment
// check for a hyphen at the beginning of a path segment
fn no_leading_hyphen(path_segment: &String) -> bool {
!path_segment.starts_with('-')
}

View file

@ -41,7 +41,7 @@ impl Formatter for CninetyNineHexFloatf {
// c99 hex has unique requirements of all floating point subs in pretty much every part of building a primitive, from prefix and suffix to need for base conversion (in all other cases if you don't have decimal you must have decimal, here it's the other way around)
// on the todo list is to have a trait for get_primitive that is implemented by each float formatter and can override a default. when that happens we can take the parts of get_primitive_dec specific to dec and spin them out to their own functions that can be overriden.
// on the todo list is to have a trait for get_primitive that is implemented by each float formatter and can override a default. when that happens we can take the parts of get_primitive_dec specific to dec and spin them out to their own functions that can be overridden.
#[allow(unused_variables)]
#[allow(unused_assignments)]
fn get_primitive_hex(inprefix: &InPrefix,
@ -93,7 +93,7 @@ fn get_primitive_hex(inprefix: &InPrefix,
// the addition or subtraction of 4 (2**4, because 4 bits in a hex digit)
// to the exponent.
// decimal's going to be a little more complicated. correct simulation
// of glibc will require after-decimal division to a specified precisino.
// of glibc will require after-decimal division to a specified precision.
// the difficult part of this (arrnum_int_div_step) is already implemented.
// the hex float name may be a bit misleading in terms of how to go about the

View file

@ -16,7 +16,7 @@ pub fn warn_expected_numeric(pf_arg: &String) {
cli::err_msg(&format!("{}: expected a numeric value", pf_arg));
}
// when character costant arguments have excess characters
// when character constant arguments have excess characters
// issue a warning when POSIXLY_CORRECT is not set
fn warn_char_constant_ign(remaining_bytes: Vec<u8>) {
match env::var("POSIXLY_CORRECT") {

View file

@ -17,7 +17,7 @@ pub trait Token {
// at a position in a format string, and sees whether
// it can return a token of a type it knows how to produce
// if so, return the token, move the iterator past the
// format string text the token repsresents, and if an
// format string text the token represents, and if an
// argument is used move the argument iter forward one
// creating token of a format string segment should also cause

View file

@ -170,7 +170,7 @@ impl UnescapedText {
}
// take an iteratator to a string,
// take an iterator to a string,
// and return a wrapper around a Vec<u8> of unescaped bytes
// break on encounter of sub symbol ('%[^%]') unless called
// through %b subst.

View file

@ -55,7 +55,7 @@ pub unsafe extern "C" fn utmpxname(_file: *const libc::c_char) -> libc::c_int {
0
}
// In case the c_char array doesn' t end with NULL
// In case the c_char array doesn't end with NULL
macro_rules! chars2string {
($arr:expr) => (
$arr.iter().take_while(|i| **i > 0).map(|&i| i as u8 as char).collect::<String>()

View file

@ -16,8 +16,8 @@ static ALPHA_OUT: &'static str = "
0000033
";
// XXX We could do a better job of ensuring that we have a fresh temp dir to ourself,
// not a general one ful of other proc's leftovers.
// XXX We could do a better job of ensuring that we have a fresh temp dir to ourselves,
// not a general one full of other proc's leftovers.
// Test that od can read one file and dump with default format
#[test]
@ -72,7 +72,7 @@ fn test_2files() {
let _ = remove_file(file2);
}
// Test that od gives non-0 exit val for filename that dosen't exist.
// Test that od gives non-0 exit val for filename that doesn't exist.
#[test]
fn test_no_file() {
let temp = env::temp_dir();