Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos. #291

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kconfig/lxdialog/menubox.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ int dialog_menu(const char *title, const char *prompt,
key == KEY_UP || key == KEY_DOWN ||
key == '-' || key == '+' ||
key == KEY_PPAGE || key == KEY_NPAGE) {
/* Remove highligt of current item */
/* Remove highlight of current item */
print_item(scroll + choice, choice, FALSE);

if (key == KEY_UP || key == '-') {
Expand Down
2 changes: 1 addition & 1 deletion kconfig/lxdialog/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ int first_alpha(const char *string, const char *exempt)
* lxdialog suggest <ESC> <ESC> which is correctly translated to two
* times esc. But then we need to ignore the second esc to avoid stepping
* out one menu too much. Filter away all escaped key sequences since
* keypad(FALSE) turn off ncurses support for escape sequences - and thats
* keypad(FALSE) turn off ncurses support for escape sequences - and that's
* needed to make notimeout() do as expected.
*/
int on_key_esc(WINDOW *win)
Expand Down
2 changes: 1 addition & 1 deletion kconfig/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int file_write_dep(const char *name)
}


/* Allocate initial growable sting */
/* Allocate initial growable string */
struct gstr str_new(void)
{
struct gstr gs;
Expand Down
2 changes: 1 addition & 1 deletion lib/env.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Can't trust libc not to leak enviornment variable memory, so...
// Can't trust libc not to leak environment variable memory, so...

#include "toys.h"

Expand Down
2 changes: 1 addition & 1 deletion lib/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ void mode_to_string(mode_t mode, char *buf)
}

// basename() can modify its argument or return a pointer to a constant string
// This just gives after the last '/' or the whole stirng if no /
// This just gives after the last '/' or the whole string if no /
char *getbasename(char *name)
{
char *s = strrchr(name, '/');
Expand Down
2 changes: 1 addition & 1 deletion lib/linestack.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "toys.h"

// The design idea here is indexing a big blob of (potentially mmaped) data
// instead of copying the data into a zillion seperate malloc()s.
// instead of copying the data into a zillion separate malloc()s.

// A linestack is an array of struct ptr_len, with a currently used len
// and max tracking the memory allocation. This indexes existing string data,
Expand Down
2 changes: 1 addition & 1 deletion lib/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int terminal_size(unsigned *xx, unsigned *yy)
return x || y;
}

// Query terminal size, sending ANSI probe if necesary. (Probe queries xterm
// Query terminal size, sending ANSI probe if necessary. (Probe queries xterm
// size through serial connection, when local TTY doesn't know but remote does.)
// Returns 0 if ANSI probe sent, 1 if size determined from tty or environment

Expand Down
2 changes: 1 addition & 1 deletion tests/readelf.test
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Program Headers:
" "" ""

# binutils doesn't line up the column headers for 64-bit ELF files.
# TODO: binutils readelf lies about trailing NULL entires binutils ld produces
# TODO: binutils readelf lies about trailing NULL entries binutils ld produces
NOSPACE=1 toyonly testing "-d" "readelf -dW $elf-full" "
Dynamic section at offset 0xd98 contains 33 entries:
Tag Type Name/Value
Expand Down
2 changes: 1 addition & 1 deletion tests/sh.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# // ${#} ${#x} ${#@} ${#x[@]} ${#!} ${!#}
# // ${!} ${!@} ${!@Q} ${!x} ${!x@} ${!x@Q} ${!x#} ${!x[} ${!x[*]}

# Looked like a prefix but wasn't: three chars (@ # -) are both paremeter name
# Looked like a prefix but wasn't: three chars (@ # -) are both parameter name
# and slice operator. When immediately followed by } it's parameter, otherwise
# we did NOT have a prefix and it's an operator.
#
Expand Down
4 changes: 2 additions & 2 deletions toys/lsb/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ config MOUNT
# helo
# usage: smbmount SHARE DIR
#
# Mount smb share with user/pasword prompt as necessary.
# Mount smb share with user/password prompt as necessary.
#
#config NFSMOUNT
# bool "nfsmount"
Expand Down Expand Up @@ -309,7 +309,7 @@ void mount_main(void)
for (ss = toys.optargs; *ss; ss++) {
char *sss = *ss;

// If you realy, really want to mount a file named "--", we support it.
// If you really, really want to mount a file named "--", we support it.
if (sss[0]=='-' && sss[1]=='-' && sss[2]) comma_collate(&opts, sss+2);
else if (!dev) dev = sss;
else if (!dir) dir = sss;
Expand Down
2 changes: 1 addition & 1 deletion toys/net/netcat.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void netcat_main(void)
ll = FLAG(L)|FLAG(l), type = FLAG(u) ? SOCK_DGRAM : SOCK_STREAM;
pid_t child;

// Addjust idle and quit_delay to ms or -1 for no timeout
// Adjust idle and quit_delay to ms or -1 for no timeout
TT.W = TT.W ? TT.W*1000 : -1;
TT.q = TT.q ? TT.q*1000 : -1;

Expand Down
2 changes: 1 addition & 1 deletion toys/net/netstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static void addr2str(int af, void *addr, unsigned port, char *buf, int len,
socklen_t sock_len = (af == AF_INET) ? sizeof(struct sockaddr_in)
: sizeof(struct sockaddr_in6);

// We assume that a failing getnameinfo dosn't stomp "buf" here.
// We assume that a failing getnameinfo doesn't stomp "buf" here.
for (rp = result; rp; rp = rp->ai_next)
if (!getnameinfo(rp->ai_addr, sock_len, buf, 256, 0, 0, 0)) break;
freeaddrinfo(result);
Expand Down
2 changes: 1 addition & 1 deletion toys/net/ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void ping_main(void)
if (TT.w) tw = TT.w*1000+tnext;

memset(&msg, 0, sizeof(msg));
// left enought space to store ttl value
// left enough space to store ttl value
len = CMSG_SPACE(sizeof(uint8_t));
iov.iov_base = (void *)toybuf;
iov.iov_len = sizeof(toybuf) - len;
Expand Down
2 changes: 1 addition & 1 deletion toys/other/blkdiscard.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* The -v and -p options are not supported.
* Size parsing does not match util-linux where MB, GB, TB are multiples of
* 1000 and MiB, TiB, GiB are multipes of 1024.
* 1000 and MiB, TiB, GiB are multiples of 1024.

USE_BLKDISCARD(NEWTOY(blkdiscard, "<1>1f(force)l(length)#<0o(offset)#<0s(secure)z(zeroout)[!sz]", TOYFLAG_BIN))

Expand Down
2 changes: 1 addition & 1 deletion toys/other/bzcat.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static unsigned int get_bits(struct bunzip_data *bd, char bits_wanted)
* 16 bits : Mapping table index.
*[16 bits]: symToByte[symTotal] (Mapping table. For each bit set in mapping
* table index above, read another 16 bits of mapping table data.
* If correspondig bit is unset, all bits in that mapping table
* If corresponding bit is unset, all bits in that mapping table
* section are 0.)
* 3 bits : groupCount (how many huffman tables used to encode, anywhere
* from 2 to MAX_GROUPS)
Expand Down
2 changes: 1 addition & 1 deletion toys/other/free.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Copyright 2012 Elie De Brauwer <eliedebrauwer@gmail.com>

// Flag order is signifcant: b-g are units in order, FLAG_h-1 is unit mask
// Flag order is significant: b-g are units in order, FLAG_h-1 is unit mask
USE_FREE(NEWTOY(free, "hgmkb[!hgmkb]", TOYFLAG_USR|TOYFLAG_BIN))

config FREE
Expand Down
2 changes: 1 addition & 1 deletion toys/other/inotifyd.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void inotifyd_main(void)
int left = len - (((char *)event)-(char *)buf),
size = sizeof(struct inotify_event);

// Don't dereference event if ->len is off end of bufer
// Don't dereference event if ->len is off end of buffer
if (left >= size) size += event->len;
if (left < size) break;

Expand Down
2 changes: 1 addition & 1 deletion toys/other/which.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ config WHICH
*/
#include "toys.h"

// Find an exectuable file either at a path with a slash in it (absolute or
// Find an executable file either at a path with a slash in it (absolute or
// relative to current directory), or in $PATH. Returns absolute path to file,
// or NULL if not found.

Expand Down
2 changes: 1 addition & 1 deletion toys/pending/arp.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ void arp_main(void)
if ((toys.optflags & FLAG_s) && !set_entry()) return;
if ((toys.optflags & FLAG_d) && !delete_entry()) return;

//show arp chache
//show arp cache
fd = xopenro("/proc/net/arp");
buf = get_line(fd);
free(buf); //skip first line
Expand Down
8 changes: 4 additions & 4 deletions toys/pending/dhcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static int get_interface( char *interface, int *ifindex, uint32_t *oip, uint8_t
/*
*logs messeges to syslog or console
*opening the log is still left with applet.
*FIXME: move to more relevent lib. probably libc.c
*FIXME: move to more relevant lib. probably libc.c
*/
static void infomsg(uint8_t infomode, char *s, ...)
{
Expand All @@ -341,7 +341,7 @@ static void infomsg(uint8_t infomode, char *s, ...)
/*
* Writes self PID in file PATH
* FIXME: libc implementation only writes in /var/run
* this is more generic as some implemenation may provide
* this is more generic as some implementation may provide
* arguments to write in specific file. as dhcpd does.
*/
static void write_pid(char *path)
Expand All @@ -356,7 +356,7 @@ static void write_pid(char *path)
}
}

// String STR to UINT32 conversion strored in VAR
// String STR to UINT32 conversion stored in VAR
static long strtou32( char *str)
{
char *endptr = NULL;
Expand Down Expand Up @@ -624,7 +624,7 @@ static int mode_app(void)
}
setsockopt(state->sockfd, SOL_SOCKET, SO_REUSEADDR, &set, sizeof(set));
if (setsockopt(state->sockfd, SOL_SOCKET, SO_BROADCAST, &set, sizeof(set)) == -1) {
dbg("MODE APP : brodcast failed.\n");
dbg("MODE APP : broadcast failed.\n");
close(state->sockfd);
return -1;
}
Expand Down
10 changes: 5 additions & 5 deletions toys/pending/dhcpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ static int get_interface(const char *interface, int *ifindex, void *oip,
/*
*logs messeges to syslog or console
*opening the log is still left with applet.
*FIXME: move to more relevent lib. probably libc.c
*FIXME: move to more relevant lib. probably libc.c
*/
static void infomsg(uint8_t infomode, char *s, ...)
{
Expand All @@ -456,7 +456,7 @@ static void infomsg(uint8_t infomode, char *s, ...)
/*
* Writes self PID in file PATH
* FIXME: libc implementation only writes in /var/run
* this is more generic as some implemenation may provide
* this is more generic as some implementation may provide
* arguments to write in specific file. as dhcpd does.
*/
static void write_pid(char *path)
Expand Down Expand Up @@ -494,7 +494,7 @@ static int setup_signal()
return 0;
}

// String STR to UINT32 conversion strored in VAR
// String STR to UINT32 conversion stored in VAR
static int strtou32(const char *str, void *var)
{
char *endptr = NULL;
Expand Down Expand Up @@ -830,7 +830,7 @@ static int open_listensock(void)
gstate.listensock = xsocket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
setsockopt(gstate.listensock, SOL_SOCKET, SO_REUSEADDR, &constone, sizeof(constone));
if (setsockopt(gstate.listensock, SOL_SOCKET, SO_BROADCAST, &constone, sizeof(constone)) == -1) {
error_msg("failed to receive brodcast packets.\n");
error_msg("failed to receive broadcast packets.\n");
close(gstate.listensock);
return -1;
}
Expand Down Expand Up @@ -1125,7 +1125,7 @@ static uint8_t* get_optval6(uint8_t *optptr, uint16_t opt, uint16_t *datalen, vo
return optptr;
}

// Retrives Requested Parameter list from dhcp req packet.
// Retrieves Requested Parameter list from dhcp req packet.
static uint8_t get_reqparam(uint8_t **list)
{
uint8_t len, *optptr;
Expand Down
8 changes: 4 additions & 4 deletions toys/pending/diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static void free_candidates(struct candidate *c)
* 2.b. if s = k (fence reached move it further) do K[k + 2] = K[k + 1], k++
* 3. if E[p].last true break i.e we have reached at the end of an equiv class
* else p = p + 1 //keep traversing the equiv class.
* 4. K[r] = c //Save the sucessfully filled k-candidate.
* 4. K[r] = c //Save the successfully filled k-candidate.
*/
static void do_merge(struct candidate **K, int *k, int i,
struct v_vector *E, int p)
Expand Down Expand Up @@ -249,13 +249,13 @@ int bcomp(const void *a, const void *b)
/* file[0] corresponds file 1 and file[1] correspond file 2.
* 1. calc hashes for both the files and store them in vector(v[0], v[1])
* 2. sort file[1] with hash as primary and serial as sec. key
* 3. Form the equivalance class of file[1] stored in e vector. It lists all the equivalence
* 3. Form the equivalence class of file[1] stored in e vector. It lists all the equivalence
* classes of lines in file[1], with e.last = true on the last element of each class.
* The elements are ordered by serial within classes.
* 4. Form the p vector stored in p_vector. p_vector[i], if non-zero, now points in e vector
* to the beginning of the equiv class of lines in file[1] equivalent to line
* i in file[0].
* 5. Form the k-candidates as discribed in do_merge.
* 5. Form the k-candidates as described in do_merge.
* 6. Create a vector J[i] = j, such that i'th line in file[0] is j'th line of
* file[1], i.e J comprises LCS
*/
Expand Down Expand Up @@ -866,7 +866,7 @@ void diff_main(void)
&& (S_ISDIR(TT.st[0].st_mode) || S_ISDIR(TT.st[1].st_mode)))
error_exit("can't compare stdin to directory");

if ((TT.st[0].st_ino == TT.st[1].st_ino) //physicaly same device
if ((TT.st[0].st_ino == TT.st[1].st_ino) //physically same device
&& (TT.st[0].st_dev == TT.st[1].st_dev)) {
toys.exitval = 0;
return show_status(files);
Expand Down
2 changes: 1 addition & 1 deletion toys/pending/expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void eval_op(struct op_def *o, struct value *ret, struct value *rhs)
}
}

// Evalute a compound expression using recursive "Precedence Climbing"
// Evaluate a compound expression using recursive "Precedence Climbing"
// algorithm, setting 'ret'.
static void eval_expr(struct value *ret, int min_prec)
{
Expand Down
20 changes: 10 additions & 10 deletions toys/pending/fdisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static void read_geometry(struct hd_geometry *disk)
}

/* Read the extended boot record for the
* logical partion details.
* logical partition details.
*/
static void read_ebr(int idx)
{
Expand Down Expand Up @@ -263,7 +263,7 @@ static void read_ebr(int idx)
close(dev_fd);
error_exit("Couldn't read sector zero\n");
}
num_parts++; //extended partions present.
num_parts++; //extended partitions present.
q = part_offset(sec_buf, 1);
} while (!is_partition_clear(q) && IS_EXTENDED(q->sys_ind));
}
Expand Down Expand Up @@ -315,7 +315,7 @@ static inline void write_table_flag(char *buf)
}

/* free the buffers used for holding details of
* extended logical partions
* extended logical partitions
*/
static void free_bufs(void)
{
Expand Down Expand Up @@ -374,7 +374,7 @@ static int read_mbr(char *device, int validate)
total_number_sectors = read_size(); //Device size
read_sec_sz();
sector_fac = g_sect_size/SECTOR_SIZE; //512 is hardware sector size.
physical_HS(&h, &s); //physical dimensions may be diferent from HDIO_GETGEO
physical_HS(&h, &s); //physical dimensions may be different from HDIO_GETGEO
g_sectors = (FLAG(S) && TT.sectors) ? TT.sectors : s ? s : disk.sectors ? disk.sectors : 63;
g_heads = (FLAG(H) && TT.heads) ? TT.heads : h ? h : disk.heads ? disk.heads : 255;
g_cylinders = total_number_sectors/(g_heads * g_sectors * sector_fac);
Expand Down Expand Up @@ -600,15 +600,15 @@ void delete_partition(int i)
num_parts = 4;
} else {
//only logical is delete, need to move the rest of them backwards
if (i == 4) { //move partiton# 6 to 5.
if (i == 4) { //move partition# 6 to 5.
partitions[i].modified = 1;
if (num_parts > i+1) {
q = partitions[i + 1].part;
*p = *q; //copy the part table
ext_p = part_offset(partitions[i].sec_buffer, 1);
ext_q = part_offset(partitions[i + 1].sec_buffer, 1);
*ext_p = *ext_q; //copy the extended info pointer
// change the start of the 4th partiton.
// change the start of the 4th partition.
new_start = partitions[i + 1].start_offset + swap_le32toh(q->start4) - extended_offset;
new_start = SWAP_LE32(new_start);
memcpy(p->start4, (void *)&new_start, 4);
Expand Down Expand Up @@ -721,7 +721,7 @@ static int get_free_partition(int max)
return num;
}

//taking user input for partition start/end sectors/cyinders
//taking user input for partition start/end sectors/cylinders
static uint32_t ask_value(char *mesg, sector_t left, sector_t right, sector_t defalt)
{
char *str = toybuf;
Expand Down Expand Up @@ -820,7 +820,7 @@ static sector_t ask_start_sector(int idx, sector_t* begin, sector_t* end, int ex
if (disp_unit_cyl) limit = (sector_t)g_sectors * g_heads * g_cylinders - 1;
else limit = total_number_sectors - 1;

if (disp_unit_cyl) //make the begin of every partition to cylnder boundary
if (disp_unit_cyl) //make the beginning of every partition to cylinder boundary
for (i = 0; i < num_parts; i++)
begin[i] = (begin[i]/(g_heads* g_sectors)) * (g_heads* g_sectors);

Expand Down Expand Up @@ -873,7 +873,7 @@ static sector_t ask_end_sector(int idx, sector_t* begin, sector_t* end, int ext_
if (disp_unit_cyl) limit = (sector_t)g_sectors * g_heads * g_cylinders - 1;
else limit = total_number_sectors - 1;

if (disp_unit_cyl) //make the begin of every partition to cylnder boundary
if (disp_unit_cyl) //make the beginning of every partition to cylinder boundary
for (i = 0; i < num_parts; i++)
begin[i] = (begin[i]/(g_heads* g_sectors)) * (g_heads* g_sectors);

Expand Down Expand Up @@ -993,7 +993,7 @@ static void add_logical_partition(void)
else add_partition(num_parts -1, LINUX_NATIVE);
}

/* Add a new partiton to the partition table.
/* Add a new partition to the partition table.
* MAX partitions limit is taken to be 60, can be changed
*/
static void add_new_partition(void)
Expand Down
2 changes: 1 addition & 1 deletion toys/pending/getty.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static void termios_init(void)
if (tcsetattr(0, TCSANOW, &TT.termios) < 0) perror_exit("tcsetattr");
}

// Get the baud rate from modems CONNECT mesage, Its of form <junk><BAUD><Junk>
// Get the baud rate from modems CONNECT message, It's of form <junk><BAUD><Junk>
static void sense_baud(void)
{
int vmin, speed;
Expand Down
Loading