Skip to content

Commit ac653c6

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 64f36cd commit ac653c6

File tree

38 files changed

+123
-135
lines changed

38 files changed

+123
-135
lines changed

COPYRIGHT

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ ksh 93u+m general copyright notice
2323
2424
# atheik <[email protected]> #
2525
# Vincent Mihalkovic <[email protected]> #
26-
# dnewhall <[email protected]> #
2726
# Ryan Schmidt <[email protected]> #
2827
# Harald van Dijk <[email protected]> #
28+
# dnewhall <[email protected]> #
2929
# Chase <[email protected]> #
30-
# rymrg <[email protected]> #
31-
# hyousatsu <[email protected]> #
3230
# Trey Valenta <[email protected]> #
3331
# Sterling Jensen <[email protected]> #
3432
# SHIMIZU Akifumi <[email protected]> #
33+
# rymrg <[email protected]> #
3534
# Marc Wilson <[email protected]> #
35+
# hyousatsu <[email protected]> #
3636
# Govind Kamat <[email protected]> #
3737
# Cy Schubert <[email protected]> #
3838
# Andy Fiddaman <[email protected]> #
@@ -45,6 +45,7 @@ ksh 93u+m general copyright notice
4545
# Siteshwar Vashisht <[email protected]> #
4646
# Kurtis Rader <[email protected]> #
4747
# Roland Mainz <[email protected]> #
48+
# Paulo Andrade <[email protected]> #
4849
# Finnbarr P. Murphy <[email protected]> #
4950
# Lijo George <[email protected]> #
5051
# Perette Barella <[email protected]> #

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) case $2 in
395395
'') exec 1>&2 ;;
396396
esac

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
@@ -217,7 +217,6 @@ int b_alias(int argc,char *argv[],Shbltin_t *context)
217217
int b_float(int argc,char *argv[],Shbltin_t *context){}
218218
int b_functions(int argc,char *argv[],Shbltin_t *context){}
219219
int b_integer(int argc,char *argv[],Shbltin_t *context){}
220-
int b_local(int argc,char *argv[],Shbltin_t *context){}
221220
int b_nameref(int argc,char *argv[],Shbltin_t *context){}
222221
#endif
223222
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
@@ -593,9 +593,9 @@ const char sh_optdot[] =
593593
"[+SEE ALSO?\bcommand\b(1), \bksh\b(1)]"
594594
;
595595

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

600600
const char sh_opteval[] =
601601
"[-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
@@ -154,9 +154,9 @@ extern const char sh_optcd[];
154154
extern const char sh_optcommand[];
155155
extern const char sh_optcont[];
156156
extern const char sh_optdot[];
157-
#ifndef ECHOPRINT
157+
#if !SHOPT_ECHOPRINT
158158
extern const char sh_optecho[];
159-
#endif /* !ECHOPRINT */
159+
#endif
160160
extern const char sh_optenum[];
161161
extern const char sh_opteval[];
162162
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
@@ -19,7 +19,7 @@
1919

2020
#ifndef SH_VALNOD
2121

22-
#include <option.h>
22+
#include <option.h>
2323
#include <nval.h>
2424

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

src/cmd/ksh93/sh/init.c

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@
2929
*/
3030

3131
#include "shopt.h"
32-
#include "defs.h"
33-
#include <pwd.h>
34-
#include <tmx.h>
35-
#include <regex.h>
32+
#include "defs.h"
33+
#include <pwd.h>
34+
#include <tmx.h>
35+
#include <regex.h>
3636
#include <math.h>
3737
#include <ast_random.h>
38-
#include "variables.h"
39-
#include "path.h"
40-
#include "fault.h"
41-
#include "name.h"
38+
#include "variables.h"
39+
#include "path.h"
40+
#include "fault.h"
41+
#include "name.h"
4242
#include "edit.h"
4343
#include "jobs.h"
4444
#include "io.h"
@@ -1345,10 +1345,6 @@ Shell_t *sh_init(int argc,char *argv[], Shinit_f userinit)
13451345
sh.shname = sh_strdup(argv[0]);
13461346
else
13471347
sh.shname = sh_strdup(sh.st.dolv[0]);
1348-
/*
1349-
* return here for shell script execution
1350-
* but not for parenthesis subshells
1351-
*/
13521348
error_info.id = sh_strdup(sh.st.dolv[0]); /* error_info.id is $0 */
13531349
sh.jmpbuffer = &sh.checkbase;
13541350
sh_pushcontext(&sh.checkbase,SH_JMPSCRIPT);
@@ -1554,7 +1550,7 @@ void sh_reinit(void)
15541550
}
15551551

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

0 commit comments

Comments
 (0)