diff --git a/src/cmd/ksh93/bltins/hist.c b/src/cmd/ksh93/bltins/hist.c index fae42d688492..4be11d1a6a9b 100644 --- a/src/cmd/ksh93/bltins/hist.c +++ b/src/cmd/ksh93/bltins/hist.c @@ -30,18 +30,7 @@ #define HIST_RECURSE 5 -#if SHOPT_SCRIPTONLY - -int b_hist(int argc,char *argv[], Shbltin_t *context) -{ - NOT_USED(argc); - NOT_USED(argv); - NOT_USED(context); - errormsg(SH_DICT,ERROR_exit(1),e_scriptonly); - UNREACHABLE(); -} - -#else +#if !SHOPT_SCRIPTONLY static void hist_subst(const char*, int fd, char*); @@ -336,4 +325,15 @@ static void hist_subst(const char *command,int fd,char *replace) sh_eval(sfopen(NULL,sp,"s"),1); } -#endif /* SHOPT_SCRIPTONLY */ +#else + +int b_hist(int argc,char *argv[], Shbltin_t *context) +{ + NOT_USED(argc); + NOT_USED(argv); + NOT_USED(context); + errormsg(SH_DICT,ERROR_exit(1),e_scriptonly); + UNREACHABLE(); +} + +#endif /* !SHOPT_SCRIPTONLY */ diff --git a/src/cmd/ksh93/bltins/mkservice.c b/src/cmd/ksh93/bltins/mkservice.c index bb06e3a5db9d..af0c21452682 100644 --- a/src/cmd/ksh93/bltins/mkservice.c +++ b/src/cmd/ksh93/bltins/mkservice.c @@ -25,9 +25,7 @@ #include "shopt.h" #include "defs.h" -#if !SHOPT_MKSERVICE -NoN(mkservice) -#else +#if SHOPT_MKSERVICE static const char mkservice_usage[] = "[-?\n@(#)$Id: mkservice (AT&T Research) 2001-06-13 $\n]" @@ -497,4 +495,6 @@ int b_eloop(int argc, char** argv, Shbltin_t *context) return errno != 0; } +#else +NoN(mkservice) #endif /* SHOPT_MKSERVICE */ diff --git a/src/cmd/ksh93/edit/completion.c b/src/cmd/ksh93/edit/completion.c index ffb898793911..acdc25dc47f7 100644 --- a/src/cmd/ksh93/edit/completion.c +++ b/src/cmd/ksh93/edit/completion.c @@ -24,9 +24,7 @@ #include "shopt.h" #include "defs.h" -#if SHOPT_SCRIPTONLY -NoN(completion) -#else +#if !SHOPT_SCRIPTONLY #include #include "lexstates.h" @@ -663,4 +661,6 @@ int ed_fulledit(Edit_t *ep) return 0; } -#endif /* SHOPT_SCRIPTONLY */ +#else +NoN(completion) +#endif /* !SHOPT_SCRIPTONLY */ diff --git a/src/cmd/ksh93/edit/emacs.c b/src/cmd/ksh93/edit/emacs.c index 5c9c33b6daa9..f3a5b984fae1 100644 --- a/src/cmd/ksh93/edit/emacs.c +++ b/src/cmd/ksh93/edit/emacs.c @@ -62,9 +62,7 @@ One line screen editor for any program #include "shopt.h" #include -#if !SHOPT_ESH -NoN(emacs) -#else +#if SHOPT_ESH #include #include "defs.h" @@ -1798,4 +1796,7 @@ static char blankline(Emacs_t *ep, genchar *out) } return 1; } -#endif /* !SHOPT_ESH */ + +#else +NoN(emacs) +#endif /* SHOPT_ESH */ diff --git a/src/cmd/ksh93/edit/hexpand.c b/src/cmd/ksh93/edit/hexpand.c index c8eb9e76162f..66964bf799a1 100644 --- a/src/cmd/ksh93/edit/hexpand.c +++ b/src/cmd/ksh93/edit/hexpand.c @@ -34,11 +34,7 @@ #include "defs.h" #include "edit.h" -#if ! SHOPT_HISTEXPAND - -NoN(hexpand) - -#else +#if SHOPT_HISTEXPAND static char *modifiers = "htrepqxs&"; static int mod_flags[] = { 0, 0, 0, 0, HIST_PRINT, HIST_QUOTE, HIST_QUOTE|HIST_QUOTE_BR, 0, 0 }; @@ -721,7 +717,6 @@ int hist_expand(const char *ln, char **xp) sfputc(sh.stk,'\0'); done: - if(cc && (flag&HIST_HASH)) { /* close !# temp file */ sfclose(ref); @@ -749,4 +744,6 @@ int hist_expand(const char *ln, char **xp) return flag & HIST_ERROR ? HIST_ERROR : flag & HIST_FLAG_RETURN_MASK; } -#endif /* !SHOPT_HISTEXPAND */ +#else +NoN(hexpand) +#endif /* SHOPT_HISTEXPAND */ diff --git a/src/cmd/ksh93/edit/history.c b/src/cmd/ksh93/edit/history.c index f3672bf6e220..5993afe5a27d 100644 --- a/src/cmd/ksh93/edit/history.c +++ b/src/cmd/ksh93/edit/history.c @@ -41,9 +41,7 @@ #include "shopt.h" #include -#if SHOPT_SCRIPTONLY -NoN(history) -#else +#if !SHOPT_SCRIPTONLY #define HIST_MAX (sizeof(int)*HIST_BSIZE) #define HIST_BIG (0100000-1024) /* 1K less than maximum short */ @@ -1135,4 +1133,6 @@ static int hist_exceptf(Sfio_t* fp, int type, void *data, Sfdisc_t *handle) return 0; } -#endif /* SHOPT_SCRIPTONLY */ +#else +NoN(history) +#endif /* !SHOPT_SCRIPTONLY */ diff --git a/src/cmd/ksh93/edit/vi.c b/src/cmd/ksh93/edit/vi.c index 79131d727332..71f8c900cae2 100644 --- a/src/cmd/ksh93/edit/vi.c +++ b/src/cmd/ksh93/edit/vi.c @@ -29,9 +29,7 @@ #include "shopt.h" #include "defs.h" -#if !SHOPT_VSH -NoN(vi) -#else +#if SHOPT_VSH #include "io.h" #include "history.h" @@ -2706,4 +2704,6 @@ static int getrchar(Vi_t *vp) return c; } -#endif /* !SHOPT_VSH */ +#else +NoN(vi) +#endif /* SHOPT_VSH */