Skip to content

Commit

Permalink
Fix a large amount of whitespace issues in the code
Browse files Browse the repository at this point in the history
Inconsistent tab indentation is annoying, especially if you set
your tab width to something other than 8 spaces. This commit fixes
indentation by converting all sets of 8 leading spaces to tabs.

Trailing tabs and spaces are also removed (even on lines consisting
of only tabs or spaces).
  • Loading branch information
McDutchie committed Dec 1, 2024
1 parent e19063f commit 0388398
Show file tree
Hide file tree
Showing 167 changed files with 867 additions and 867 deletions.
2 changes: 1 addition & 1 deletion src/cmd/INIT/iffe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2309,7 +2309,7 @@ int x;
# NOTE() support

case $ext in
*"<stdio.h>"*)
*"<stdio.h>"*)
case $ext in
*"#define NOTE("*)
;;
Expand Down
6 changes: 3 additions & 3 deletions src/cmd/INIT/mamake.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ static Dict_item_t *search(Dict_t *dict, char *name, int create)
if (!(cmp = strcmp(name, root->name)))
break;
else if (cmp < 0)
{
{
if (root->left && (cmp = strcmp(name, root->left->name)) <= 0)
{
/* rotate(left, right) */
Expand All @@ -602,7 +602,7 @@ static Dict_item_t *search(Dict_t *dict, char *name, int create)
right->left = NULL;
}
else
{
{
if (root->right && (cmp = strcmp(name, root->right->name)) >= 0)
{
/* rotate(right, left) */
Expand Down Expand Up @@ -3084,7 +3084,7 @@ int main(int argc, char **argv)
*/

if (SA_RESTART && state.maxjobs > 1)
{
{
struct sigaction act;
sigemptyset(&empty_sigmask);
act.sa_handler = sigchld_dummy;
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/DESIGN
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ sh directory:
8. fcin.c contains code for reading and writing a character
at a time from a file or string.
9. init.c contains initialization code and callbacks
for get and set functions for built-in variables.
for get and set functions for built-in variables.
10. io.o contains code for redirections and managing file
descriptors and file streams.
11. jobs.c contains the code for job management.
Expand Down
8 changes: 4 additions & 4 deletions src/cmd/ksh93/RELEASE88
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ of ksh.
then ${foo.bar} is equivalent to ${.top.bar}. When used as the
index of a for or select loop, each assignment causes a
new name reference to occur.

l. The KEYBD trap has been added which is triggered when a key
or escape sequence is typed while reading from the keyboard
in an edit mode. This, combined with some new variables
Expand Down Expand Up @@ -220,7 +220,7 @@ of ksh.
2. Functions declared as function name, preserve the old ksh
semantics can be also used as the first argument to the dot (.)
command to have them executed in a dot script environment.

c. The command search rules have changed as follows:
1. Special built-ins (those with a dagger in front of them) are
executed first.
Expand Down Expand Up @@ -315,7 +315,7 @@ of ksh.
timeout after n seconds when reading from a slow device.
3. A -d char option has been added which causes the read
to terminate at char rather than at new-line.

n. The trap command has been changed as follows:
1. Trap names can be either upper case or lower case.
2. Trap -p only causes the specified trap values to be displayed.
Expand Down Expand Up @@ -409,7 +409,7 @@ of ksh.
e. There are far fewer global names. This should make it
must easier to add built-in commands without worrying
about conflicts.

f. The code uses the sfio library which makes it possible
to mix with stdio.

Expand Down
4 changes: 2 additions & 2 deletions src/cmd/ksh93/bltins/alarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* *
* This software is part of the ast package *
* Copyright (c) 1982-2012 AT&T Intellectual Property *
* Copyright (c) 2020-2023 Contributors to ksh 93u+m *
* Copyright (c) 2020-2024 Contributors to ksh 93u+m *
* and is licensed under the *
* Eclipse Public License, Version 2.0 *
* *
Expand Down Expand Up @@ -164,7 +164,7 @@ void sh_timetraps(void)
*/
static char *setdisc(Namval_t *np, const char *event, Namval_t* action, Namfun_t *fp)
{
struct tevent *tp = (struct tevent*)fp;
struct tevent *tp = (struct tevent*)fp;
if(!event)
return action ? Empty : (char*)ALARM;
if(strcmp(event,ALARM)!=0)
Expand Down
36 changes: 18 additions & 18 deletions src/cmd/ksh93/bltins/enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const char sh_optenum[] =
"For example, \benum bool=(false true)\b creates a Boolean variable "
"type of which variables may be declared like \bbool x=true y=false\b.]"
"[+?If the list of \avalue\as is omitted, then \atypename\a must name an "
"indexed array variable with at least two elements.]"
"indexed array variable with at least two elements.]"
"[+?For more information, create a type, then use \atypename\a \b--man\b.]"
"[+USE IN ARITHMETIC EXPRESSIONS?When an enumeration variable is used in an "
"arithmetic expression, its value is the index into the array that "
Expand All @@ -48,8 +48,8 @@ const char sh_optenum[] =
"\n"
"[+EXIT STATUS]"
"{"
"[+0?Successful completion.]"
"[+>0?An error occurred.]"
"[+0?Successful completion.]"
"[+>0?An error occurred.]"
"}"
"[+SEE ALSO?\bksh\b(1), \btypeset\b(1).]"
;
Expand All @@ -69,30 +69,30 @@ static const char enum_type[] =
"It is an error for an arithmetic expression to assign a value "
"outside of that range. Decimal fractions are ignored.]"
"[+?If no \aname\as are specified then the names and values of all "
"variables of this type are written to standard output.]"
"variables of this type are written to standard output.]"
"[+?\b\f?\f\b is built in to the shell as a declaration command so that "
"field splitting and pathname expansion are not performed on "
"the arguments. Tilde expansion occurs on \avalue\a.]"
"field splitting and pathname expansion are not performed on "
"the arguments. Tilde expansion occurs on \avalue\a.]"
"[r?Enables readonly. Once enabled, the value cannot be changed or unset.]"
"[a?Indexed array. Each \aname\a is converted to an indexed "
"array of type \b\f?\f\b. If a variable already exists, the current "
"value will become index \b0\b.]"
"array of type \b\f?\f\b. If a variable already exists, the current "
"value will become index \b0\b.]"
"[A?Associative array. Each \aname\a is converted to an associative "
"array of type \b\f?\f\b. If a variable already exists, the current "
"value will become subscript \b0\b.]"
"array of type \b\f?\f\b. If a variable already exists, the current "
"value will become subscript \b0\b.]"
"[h]:[string?Used within a type definition to provide a help string "
"for variable \aname\a. Otherwise, it is ignored.]"
"for variable \aname\a. Otherwise, it is ignored.]"
"[S?Used with a type definition to indicate that the variable is shared by "
"each instance of the type. When used inside a function defined "
"with the \bfunction\b reserved word, the specified variables "
"will have function static scope. Otherwise, the variable is "
"unset prior to processing the assignment list.]"
"each instance of the type. When used inside a function defined "
"with the \bfunction\b reserved word, the specified variables "
"will have function static scope. Otherwise, the variable is "
"unset prior to processing the assignment list.]"
"\n"
"\n[name[=value]...]\n"
"\n"
"[+EXIT STATUS?]{"
"[+0?Successful completion.]"
"[+>0?An error occurred.]"
"[+0?Successful completion.]"
"[+>0?An error occurred.]"
"}"

"[+SEE ALSO?\benum\b(1), \btypeset\b(1)]"
Expand Down Expand Up @@ -293,7 +293,7 @@ int b_enum(int argc, char** argv, Shbltin_t *context)
memset(&optdisc,0,sizeof(optdisc));
optdisc.opt.infof = enuminfo;
optdisc.np = tp;
nv_addtype(tp, enum_type, &optdisc.opt, sizeof(optdisc));
nv_addtype(tp, enum_type, &optdisc.opt, sizeof(optdisc));
}
return error_info.errors != 0;
}
6 changes: 3 additions & 3 deletions src/cmd/ksh93/bltins/getopts.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static int infof(Opt_t* op, Sfio_t* sp, const char* s, Optdisc_t* dp)
sfputr(sp,sh_mactry(stkfreeze(stkp,1)),-1);
stkset(stkp,savptr,savtop);
}
return 1;
return 1;
}

int b_getopts(int argc,char *argv[],Shbltin_t *context)
Expand All @@ -61,7 +61,7 @@ int b_getopts(int argc,char *argv[],Shbltin_t *context)
volatile int extended, r= -1;
struct checkpt buff, *pp;
Optdisc_t disc;
memset(&disc, 0, sizeof(disc));
memset(&disc, 0, sizeof(disc));
disc.version = OPT_VERSION;
disc.infof = infof;
value[1] = 0;
Expand Down Expand Up @@ -196,6 +196,6 @@ int b_getopts(int argc,char *argv[],Shbltin_t *context)
else
nv_putval(np, opt_info.arg, NV_RDONLY);
sh_popcontext(&buff);
opt_info.disc = 0;
opt_info.disc = 0;
return r;
}
2 changes: 1 addition & 1 deletion src/cmd/ksh93/bltins/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ int b_wait(int n,char *argv[],Shbltin_t *context)
int b_bg(int n,char *argv[],Shbltin_t *context)
{
int flag = **argv;
const char *optstr = sh_optbg;
const char *optstr = sh_optbg;
NOT_USED(context);
if(*argv[0]=='f')
optstr = sh_optfg;
Expand Down
18 changes: 9 additions & 9 deletions src/cmd/ksh93/bltins/mkservice.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static const char mkservice_usage[] =
"to be read from one of the active connections. It is "
"called with the file descriptor number that has data "
"to be read. If the function returns a non-zero "
"value, this connection will be closed.]"
"value, this connection will be closed.]"
"[+close?This function is invoked when the connection is closed.]"
"}"
"[+?If \avarname\a is unset, then all active connection, and the service "
Expand All @@ -61,8 +61,8 @@ static const char mkservice_usage[] =
"\nvarname service_path\n"
"\n"
"[+EXIT STATUS?]{"
"[+0?Success.]"
"[+>0?An error occurred.]"
"[+0?Success.]"
"[+>0?An error occurred.]"
"}"
"[+SEE ALSO?\beloop\b(1)]"
;
Expand All @@ -81,8 +81,8 @@ static const char eloop_usage[] =
"\n"
"[+EXIT STATUS?If no timeout is specified, \beloop\b will not return "
"unless interrupted. Otherwise]{"
"[+0?The specified timeout interval occurred.]"
"[+>0?An error occurred.]"
"[+0?The specified timeout interval occurred.]"
"[+>0?An error occurred.]"
"}"
"[+SEE ALSO?\bmkservice\b(1)]"
;
Expand Down Expand Up @@ -207,7 +207,7 @@ static void process_stream(Sfio_t* iop)
close(fd);
}
}

static int waitnotify(int fd, long timeout, int rw)
{
Sfio_t *special=0, **pstream;
Expand Down Expand Up @@ -335,8 +335,8 @@ static int Error(Service_t *sp, int level, const char* arg, ...)
if(sp->node)
nv_unset(sp->node);
free(sp);
errorv(NULL, ERROR_exit(1), ap);
va_end(ap);
errorv(NULL, ERROR_exit(1), ap);
va_end(ap);
return 0;
}

Expand Down Expand Up @@ -451,7 +451,7 @@ int b_mkservice(int argc, char** argv, Shbltin_t *context)
sp->fd = fd;
np = nv_open(var,sh.var_tree,NV_ARRAY|NV_VARNAME);
sp->node = np;
nv_putval(np, path, 0);
nv_putval(np, path, 0);
nv_stack(np, (Namfun_t*)sp);
service_add(sp);
return 0;
Expand Down
48 changes: 24 additions & 24 deletions src/cmd/ksh93/bltins/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,27 +469,27 @@ static int echolist(Sfio_t *outfile, int raw, char *argv[])
*/
static char strformat(char *s)
{
char* t;
int c;
char* b;
char* p;
char* t;
int c;
char* b;
char* p;
#if SHOPT_MULTIBYTE && defined(FMT_EXP_WIDE)
int w;
#endif
b = t = s;
for (;;)
{
switch (c = *s++)
{
case '\\':
b = t = s;
for (;;)
{
switch (c = *s++)
{
case '\\':
if(*s==0)
break;
#if SHOPT_MULTIBYTE && defined(FMT_EXP_WIDE)
c = chrexp(s - 1, &p, &w, FMT_EXP_CHAR|FMT_EXP_LINE|FMT_EXP_WIDE);
c = chrexp(s - 1, &p, &w, FMT_EXP_CHAR|FMT_EXP_LINE|FMT_EXP_WIDE);
#else
c = chresc(s - 1, &p);
c = chresc(s - 1, &p);
#endif
s = p;
s = p;
#if SHOPT_MULTIBYTE
#if defined(FMT_EXP_WIDE)
if(w)
Expand All @@ -512,13 +512,13 @@ static char strformat(char *s)
*t++ = '%';
c = 'Z';
}
break;
case 0:
*t = 0;
return t - b;
}
*t++ = c;
}
break;
case 0:
*t = 0;
return t - b;
}
*t++ = c;
}
}

static char *genformat(char *format)
Expand Down Expand Up @@ -647,7 +647,7 @@ static ssize_t fmtbase64(Sfio_t *iop, char *string, int alt)
else
{
size = sizeof(short);
number.i = (int)d;
number.i = (int)d;
}
}
return sfwrite(iop, &number, size);
Expand All @@ -661,7 +661,7 @@ static ssize_t fmtbase64(Sfio_t *iop, char *string, int alt)
break;
}
if(fp)
return (*fp->disc->writef)(np, iop, 0, fp);
return (*fp->disc->writef)(np, iop, 0, fp);
else
{
int n = nv_size(np);
Expand Down Expand Up @@ -800,7 +800,7 @@ static int extend(Sfio_t* sp, void* v, Sffmt_t* fe)
case 'E':
case 'F':
case 'G':
if(SFFMT_LDOUBLE)
if(SFFMT_LDOUBLE)
value->ld = 0.;
else
value->d = 0.;
Expand Down Expand Up @@ -996,7 +996,7 @@ static int extend(Sfio_t* sp, void* v, Sffmt_t* fe)
d = sh_strnum(argp,&lastchar,0);
break;
}
if(SFFMT_LDOUBLE)
if(SFFMT_LDOUBLE)
{
value->ld = d;
fe->size = sizeof(value->ld);
Expand Down
8 changes: 4 additions & 4 deletions src/cmd/ksh93/bltins/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@

struct read_save
{
char **argv;
char **argv;
char *prompt;
int fd;
int plen;
int fd;
int plen;
int flags;
ssize_t len;
Sflong_t timeout;
Sflong_t timeout;
};

int b_read(int argc,char *argv[], Shbltin_t *context)
Expand Down
Loading

0 comments on commit 0388398

Please sign in to comment.