Skip to content

ksh -n: Fix spurious warning for --(no)backslashctrl#932

Merged
McDutchie merged 4 commits intoksh93:devfrom
JohnoKing:3-warn-fix
Feb 15, 2026
Merged

ksh -n: Fix spurious warning for --(no)backslashctrl#932
McDutchie merged 4 commits intoksh93:devfrom
JohnoKing:3-warn-fix

Conversation

@JohnoKing
Copy link

src/cmd/ksh93/sh/parse.c: simple():

  • During noexec, use strmatch() to more precisely identify obsolete options passed to set(1). This fixes a bug where ksh -n would falsely flag --nobackslashctrl as obsolete, and also allows for the detection of other obsolescent options besides just -k. Additionally, do this in a loop to check all of the options passed to set (rather than just the first option).
  • Also check for and warn against the obsolete alias -x (ksh93 has never supported exported aliases).

src/cmd/ksh93/{data/builtins.c,include/builtins.h,sh/shcomp.c}:

  • More clearly document which options to set(1) are obsolete.
  • Add SYSALIAS offset macro and use that instead of strcmp.
  • Do not compile in usage information for arrowkeysearch or backslashctrl if the editor modes are not compiled in.

JohnoKing and others added 4 commits February 10, 2026 10:59
src/cmd/ksh93/sh/parse.c: simple():
- During noexec, use strmatch() to more precisely identify obsolete
  options passed to set(1). This fixes a bug where 'ksh -n' would
  falsely flag --nobackslashctrl as obsolete, and also allows for the
  detection of other obsolescent options besides just '-k'.
  Additionally, do this in a loop to check all of the options passed to
  set (rather than just the first option).
- Also check for and warn against the obsolete 'alias -x' (ksh93 has
  never supported exported aliases).

src/cmd/ksh93/{data/builtins.c,include/builtins.h,sh/shcomp.c}:
- More clearly document which options to set(1) are obsolete.
- Add SYSALIAS offset macro and use that instead of strcmp.
- Do not compile in usage information for arrowkeysearch or
  backslashctrl if the editor modes are not compiled in.
@McDutchie McDutchie merged commit 21f6362 into ksh93:dev Feb 15, 2026
McDutchie pushed a commit that referenced this pull request Feb 15, 2026
src/cmd/ksh93/sh/parse.c: simple():
- During noexec, use strmatch() to more precisely identify obsolete
  options passed to set(1). This fixes a bug where 'ksh -n' would
  falsely flag --nobackslashctrl as obsolete, and also allows for
  the detection of other obsolescent options besides just '-k'.
  Additionally, do this in a loop to check all of the options
  passed to set (rather than just the first option).
- Also check for and warn against the obsolete 'alias -x' (ksh93
  has never supported exported aliases).

src/cmd/ksh93/{data/builtins.c,include/builtins.h,sh/shcomp.c}:
- More clearly document which options to set(1) are obsolete.
- Add SYSALIAS offset macro and use that instead of strcmp.
- Do not compile in usage information for backslashctrl if the
  editor modes are not compiled in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants