1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 11:42:21 +00:00
cde/TODO
Johnothan King 8b5f11dcd7
Add support for multibyte characters to $IFS (#92)
Add support for multibyte characters to $IFS

This commit fixes BUG_MULTIBIFS, which had two bug reports in the ksh2020 branch.

src/cmd/ksh93/sh/macro.c:
- Backport Eric Scrivner's fix for multibyte IFS characters (slightly modified
  for compatibility with C89). Explanation from https://github.com/att/ast/pull/737:

  Previously, the varsub method used for the macro expansion of $param, ${param},
  and ${param op word} would incorrectly expand the internal field separator (IFS)
  if it was a multibyte character. This was due to truncation based on the
  incorrect assumption that the IFS would never be larger than a single byte.

  This change fixes this issue by carefully tracking the number of bytes that
  should be persisted in the IFS case and ensuring that all bytes are written
  during expansion and substitution.

  Bug report: https://github.com/att/ast/issues/13

- Fixed another bug that caused multibyte characters with the same initial byte
  to be treated as the same character by the IFS. This bug was occurring because
  the first byte of a multibyte character wasn't being written to the stack when
  the IFS delimiter had the same initial byte:

  $ IFS=£
  $ v='§'
  $ set -- $v
  $ v="${1-}"
  $ echo "$v" | hd # The first byte should be c2, but it isn't due to the bug
  00000000  a7 0a                                             |..|
  00000002

  Bug report: https://github.com/att/ast/issues/1372

src/cmd/ksh93/tests/variables.sh:
- Add (reworked) regression tests from ksh2020 for the multibyte IFS bugs.
- Add a regression test for att/ast#1372 based on the reproducer.
2020-07-25 19:46:11 +01:00

56 lines
2.4 KiB
Text

TODO for AT&T ksh93, 93u+m bugfix branch
______
Fix regression test failures:
- On OpenBSD, there are 15 locale-related test failures in variables.sh.
______
Fix build system:
- ksh does not currently build on NetBSD, AIX, Solaris, or QNX.
- Reimport the removed nmake. It is necessary for changes in Makefiles
to take effect. The machine-generated Mamfiles are now used as a fallback,
but they are not meant to be edited by hand.
______
Fix currently known bugs affecting shell scripting. These are identified by
their modernish IDs. For exact details, see code/comments in:
https://github.com/modernish/modernish/tree/0.16/lib/modernish/cap/
- BUG_BRACQUOT: shell quoting within bracket patterns has no effect. This
bug means the '-' retains it special meaning of 'character range', and an
initial ! (and, on some shells, ^) retains the meaning of negation, even
in quoted strings within bracket patterns, including quoted variables.
- BUG_CMDEXPAN: if the 'command' command results from an expansion, it acts
like 'command -v', showing the path of the command instead of executing it.
For example:
v=command; "$v" ls
or
set -- command ls; "$@"
don't work.
See also: https://github.com/att/ast/issues/963
- BUG_CMDSPEXIT: preceding a "special builtin"[*] (other than 'eval', 'exec',
'return' or 'exit') with 'command' does not always stop it from exiting
the shell if the builtin encounters error.
[*] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_14
- BUG_CSUBSTDO: If standard output (file descriptor 1) is closed before
entering a $(command substitution), and any other file descriptors are
redirected within the command substitution, commands such as 'echo' will
not work within the command substitution, acting as if standard output is
still closed.
- BUG_IFSGLOBS: In glob pattern matching (as in case or parameter
substitution with # and %), if IFS starts with ? or * and the "$*"
parameter expansion inserts any IFS separator characters, those characters
are erroneously interpreted as wildcards when quoted "$*" is used as the
glob pattern.
- BUG_LOOPRET2: If a 'return' command is given without a status argument
within the set of conditional commands in a 'while' or 'until' loop (i.e.,
between 'while'/'until' and 'do'), the exit status passed down from the
previous command is ignored and the function returns with status 0
instead.