1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Yet more misc. cleanups; rm SHOPT_PFSH, SHOPT_TYPEDEF

Notable changes:
- Remove SHOPT_PFSH compile-time option and associated code.
  This was meant to work with Solaris rights profiles, see:
  https://docs.oracle.com/cd/E23824_01/html/821-1461/profiles-1.html#REFMAN1profiles-1
  But it has been obsolete for years as Solaris stopped using
  it in its shipped ksh several OS versions ago, preferring a
  library-based wrapper around ksh and other shells.
  Nonetheless I experimented with the option on Solaris 11.4.
  Result: no external command will run; output of unitialised
  memory in error message. So it's already fallen victim to bit
  rot. There's nothing interesting here, so just get rid.
- Remove SHOPT_TYPEDEF compile-time option (but keep the code!).
  Turning it off caused the build to fail. It may be possible to
  fix it, but the type definition code is integral to ksh now (e.g.
  'enum' depends on much of it) so it makes no sense to disable it.
  This was removed in the ksh 93v- beta version as well.
- Remove nv_close() calls and remove nv_close() documentation from
  the nval.3 man page. This function is a dummy, present without
  any changes since the beginning of the ast-open-archive repo in
  1995. The comment was: "Currently this is a dummy, but someday
  will be needed for reference counting". 27 or more years later,
  it's time to admit it's never going to happen. (And of course,
  nv_close() calls were not being used with anything resembling
  consistency.)
- Add a null nv_close() macro to nval.h for compatibility with
  third party code that follows the old documentation.
- Add a few missing regression tests.
This commit is contained in:
Martijn Dekker 2022-02-10 13:44:43 +00:00
parent a00fe6b7fd
commit 14a43a0a88
38 changed files with 101 additions and 356 deletions

View file

@ -107,10 +107,6 @@ extern char* sh_setenviron(const char*);
# define PIPE_BUF 512
#endif
#if SHOPT_PFSH && ( !_lib_getexecuser || !_lib_free_execattr )
# undef SHOPT_PFSH
#endif
#define MATCH_MAX 64
#define SH_READEVAL 0x4000 /* for sh_eval */

View file

@ -207,6 +207,7 @@ struct Namval
#define nv_onattr(n,f) ((n)->nvflag |= (f))
#define nv_offattr(n,f) ((n)->nvflag &= ~(f))
#define nv_isarray(np) (nv_isattr((np),NV_ARRAY))
#define nv_close(np) /* no-op */
/* The following are operations for associative arrays */
#define NV_AINIT 1 /* initialize */
@ -252,7 +253,6 @@ extern Namval_t *nv_opensub(Namval_t*);
/* name-value pair function prototypes */
extern int nv_adddisc(Namval_t*, const char**, Namval_t**);
extern int nv_clone(Namval_t*, Namval_t*, int);
extern void nv_close(Namval_t*);
extern void *nv_context(Namval_t*);
extern Namval_t *nv_create(const char*, Dt_t*, int,Namfun_t*);
extern void nv_delete(Namval_t*, Dt_t*, int);

View file

@ -97,9 +97,6 @@ extern int path_complete(const char*, const char*,struct argnod**);
#if SHOPT_BRACEPAT
extern int path_generate(struct argnod*,struct argnod**);
#endif /* SHOPT_BRACEPAT */
#if SHOPT_PFSH
extern int path_xattr(const char*, char*);
#endif /* SHOPT_PFSH */
#if SHOPT_DYNAMIC
/* builtin/plugin routines */
@ -112,9 +109,6 @@ extern const char e_timeformat[];
extern const char e_badtformat[];
extern const char e_dot[];
extern const char e_funload[];
#if SHOPT_PFSH
extern const char e_pfsh[];
#endif
extern const char e_pwd[];
extern const char e_logout[];
extern const char e_alphanum[];

View file

@ -99,9 +99,6 @@ typedef union Shnode_u Shnode_t;
#define SH_NOUNSET 9
#define SH_NOGLOB 10
#define SH_ALLEXPORT 11
#if SHOPT_PFSH
#define SH_PFSH 12
#endif
#define SH_IGNOREEOF 13
#define SH_NOCLOBBER 14
#define SH_MARKDIRS 15