Skip to content

Commit 6571250

Browse files
committed
Yet more accumulated minor cleanups
...including: - A bunch more cosmetic whitespace fixes - src/cmd/ksh93/{init,main}.c: Fix the location of a comment about executing a #!-less script that got moved to the wrong place in ancient times - src/cmd/ksh93/tests/coprocess.sh: Remove a libcoshell test that failed to fail after removing libcoshell (re: 3613da4)
1 parent 25ae38f commit 6571250

File tree

41 files changed

+127
-139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+127
-139
lines changed

COPYRIGHT

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ ksh 93u+m general copyright notice
2626
# Ryan Schmidt <ryandesign@macports.org> #
2727
# Harald van Dijk <harald@gigawatt.nl> #
2828
# Chase <nicetrynsa@protonmail.ch> #
29-
# rymrg <54061433+rymrg@users.noreply.github.com> #
30-
# hyousatsu <118750527+hyousatsu@users.noreply.github.com> #
31-
# dnewhall <dnewhall@users.noreply.github.com> #
3229
# Trey Valenta <t@trey.net> #
3330
# Sterling Jensen <5555776+sterlingjensen@users.noreply.github.com> #
3431
# SHIMIZU Akifumi <shimizu.akifumi@fujitsu.com> #
32+
# rymrg <54061433+rymrg@users.noreply.github.com> #
3533
# Marc Wilson <posguy99@gmail.com> #
34+
# hyousatsu <118750527+hyousatsu@users.noreply.github.com> #
3635
# Govind Kamat <govind_kamat@yahoo.com> #
36+
# dnewhall <dnewhall@users.noreply.github.com> #
3737
# Cy Schubert <cy@FreeBSD.org> #
3838
# Andy Fiddaman <andy@omniosce.org> #
3939
# #
@@ -45,6 +45,7 @@ ksh 93u+m general copyright notice
4545
# Siteshwar Vashisht <svashisht@redhat.com> #
4646
# Kurtis Rader <krader@skepticism.us> #
4747
# Roland Mainz <roland.mainz@nrubsig.org> #
48+
# Paulo Andrade <pandrade@redhat.com> #
4849
# Finnbarr P. Murphy <fpm@hotmail.com> #
4950
# Lijo George <lijo.x.george@oracle.com> #
5051
# OpenSUSE ksh 93u+ patch authors #

bin/package

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ do case $# in
390390
set -x
391391
;;
392392
help|HELP|html|man|--[?m]*)
393-
case $1 in
393+
case $1 in
394394
help) code=0
395395
case $2 in
396396
'') exec 1>&2 ;;

src/cmd/INIT/README-mamake.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -586,15 +586,16 @@ maintain Mamfiles by hand. The following lists the important changes.
586586
block to declare a simple prerequisite with optional attributes.
587587
* The special expansion syntaxes `%{`*variable*`|`*sh-script*`}` and
588588
`%{`*variable*`@`*sh-script*`}` have been added, allowing the editing of
589-
variable value fields written to the script's standard input as lines or
590-
passed as positional parameters.
589+
variable value fields. The fields are either written to the script's
590+
standard input as lines, or passed as positional parameters.
591591
* **At strict level 1 and up:**
592592
* Appending attributes to `done` instead of `make` is deprecated
593593
and produces a warning.
594594
* The ignored `archive` and `joint` attributes are deprecated.
595595
* Explicitly specifying the `generated` attribute is deprecated.
596596
* The dummy `info` and `meta` commands are unavailable instead of ignored.
597-
* The `prev` may be used as an equivalent of `makp`.
597+
* The `prev` command may be used to declare a dependency on a prerequisite
598+
file. (This change is reverted at strict level 4 as `makp` was added.)
598599
* When `prev` references a previously processed target,
599600
attributes are an error instead of being ignored.
600601
* The legacy `silent` and `ignore` command prefixes are unavailable.
@@ -611,7 +612,8 @@ maintain Mamfiles by hand. The following lists the important changes.
611612
* Attempting to declare a dependency on a rule currently being made is an error.
612613
* **At strict level 4 and up:**
613614
* MAM expansions can no longer start with `${`. Only `%{` is recognized.
614-
* The `prev` command may no longer be used as an equivalent of `makp`.
615+
* The `prev` command may no longer be used to declare a dependency on a
616+
prerequisite file. The newly added command `makp` should be used instead.
615617
* The `implicit` attribute is not available.
616618
* **At strict level 5 and up:**
617619
* The new `-j` option for parallel building is allowed to take effect.

src/cmd/INIT/mamake.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ static const char usage[] =
186186
#define STREAM_MUST 0x0002 /* push() file must exist */
187187
#define STREAM_PIPE 0x0004 /* pclose() on pop() */
188188

189+
#define LIB_VARPREFIX "mam_lib" /* prefix for dependencies vars */
190+
189191
struct Rule_s;
190192

191193
typedef struct Buf_s /* buffer stream */
@@ -1117,7 +1119,8 @@ static void substitute(Buf_t *buf, char *s)
11171119
{ /*
11181120
* Perform the expansion: append the value of the variable to the buffer.
11191121
*/
1120-
if (state.strict < 2 && found_AR && strncmp(t, "mam_lib", 7) == 0)
1122+
if (state.strict < 2 && found_AR &&
1123+
strncmp(t, LIB_VARPREFIX, sizeof LIB_VARPREFIX - 1) == 0)
11211124
{ /*
11221125
* Absurd AT&T hack from 2007. The relevant src/cmd/INIT/RELEASE entry:
11231126
* 07-02-26 mamake.c: expand first of ${mam_lib*} for ${AR}
@@ -1918,8 +1921,6 @@ void append_ar_name(Buf_t *buf, char *name)
19181921
* lib is expected to be in the format "-lX"
19191922
*/
19201923

1921-
#define LIB_VARPREFIX "mam_lib"
1922-
19231924
static char *require(char *lib, int dontcare)
19241925
{
19251926
char *s, *r, varname[64];

src/cmd/ksh93/bltins/typeset.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ int b_alias(int argc,char *argv[],Shbltin_t *context)
215215
int b_float(int argc,char *argv[],Shbltin_t *context){}
216216
int b_functions(int argc,char *argv[],Shbltin_t *context){}
217217
int b_integer(int argc,char *argv[],Shbltin_t *context){}
218-
int b_local(int argc,char *argv[],Shbltin_t *context){}
219218
int b_nameref(int argc,char *argv[],Shbltin_t *context){}
220219
#endif
221220
int b_typeset(int argc,char *argv[],Shbltin_t *context)

src/cmd/ksh93/data/builtins.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,9 +591,9 @@ const char sh_optdot[] =
591591
"[+SEE ALSO?\bcommand\b(1), \bksh\b(1)]"
592592
;
593593

594-
#ifndef ECHOPRINT
594+
#if !SHOPT_ECHOPRINT
595595
const char sh_optecho[] = " [-n] [arg...]";
596-
#endif /* !ECHOPRINT */
596+
#endif
597597

598598
const char sh_opteval[] =
599599
"[-1c?\n@(#)$Id: eval (AT&T Research) 1999-07-07 $\n]"

src/cmd/ksh93/include/builtins.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ extern const char sh_optcd[];
152152
extern const char sh_optcommand[];
153153
extern const char sh_optcont[];
154154
extern const char sh_optdot[];
155-
#ifndef ECHOPRINT
155+
#if !SHOPT_ECHOPRINT
156156
extern const char sh_optecho[];
157-
#endif /* !ECHOPRINT */
157+
#endif
158158
extern const char sh_optenum[];
159159
extern const char sh_opteval[];
160160
extern const char sh_optexec[];

src/cmd/ksh93/include/edit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#define SEARCHSIZE 80
2929

3030
#include "FEATURE/cmds"
31-
#include "FEATURE/locale"
31+
#include "FEATURE/locale"
3232
#include "terminal.h"
3333

3434
#define STRIP 0377

src/cmd/ksh93/include/variables.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#ifndef SH_VALNOD
2020

21-
#include <option.h>
21+
#include <option.h>
2222
#include <nval.h>
2323

2424
/* used for RANDNOD ($RANDOM) */

src/cmd/ksh93/sh/init.c

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
*/
2929

3030
#include "shopt.h"
31-
#include "defs.h"
32-
#include <pwd.h>
33-
#include <tmx.h>
34-
#include <regex.h>
31+
#include "defs.h"
32+
#include <pwd.h>
33+
#include <tmx.h>
34+
#include <regex.h>
3535
#include <math.h>
36-
#include "variables.h"
37-
#include "path.h"
38-
#include "fault.h"
39-
#include "name.h"
36+
#include "variables.h"
37+
#include "path.h"
38+
#include "fault.h"
39+
#include "name.h"
4040
#include "edit.h"
4141
#include "jobs.h"
4242
#include "io.h"
@@ -1343,10 +1343,6 @@ Shell_t *sh_init(int argc,char *argv[], Shinit_f userinit)
13431343
sh.shname = sh_strdup(argv[0]);
13441344
else
13451345
sh.shname = sh_strdup(sh.st.dolv[0]);
1346-
/*
1347-
* return here for shell script execution
1348-
* but not for parenthesis subshells
1349-
*/
13501346
error_info.id = sh_strdup(sh.st.dolv[0]); /* error_info.id is $0 */
13511347
sh.jmpbuffer = &sh.checkbase;
13521348
sh_pushcontext(&sh.checkbase,SH_JMPSCRIPT);
@@ -1555,7 +1551,7 @@ void sh_reinit(void)
15551551
}
15561552

15571553
/*
1558-
* set when creating a local variable of this name
1554+
* return discipline function tree pointer if a local variable of this name should share the parent's discipline function(s)
15591555
*/
15601556
Namfun_t *nv_cover(Namval_t *np)
15611557
{

0 commit comments

Comments
 (0)