Go to file
kre 5f92382c9a Add support for $'...' quoting (based upon C "..." strings, with \ expansions.)
Implementation largely obtained from FreeBSD, with adaptations to meet the
needs and style of this sh, some updates to agree with the current POSIX spec,
and a few other minor changes.

The POSIX spec for this ( http://austingroupbugs.net/view.php?id=249 )
[see note 2809 for the current proposed text] is yet to be approved,
so might change.  It currently leaves several aspects as unspecified,
this implementation handles those as:

Where more than 2 hex digits follow \x this implementation processes the
first two as hex, the following characters are processed as if the \x
sequence was not present.  The value obtained from a \nnn octal sequence
is truncated to the low 8 bits (if a bigger value is written, eg: \456.)
Invalid escape sequences are errors.  Invalid \u (or \U) code points are
errors if known to be invalid, otherwise can generate a '?' character.
Where any escape sequence generates nul ('\0') that char, and the rest of
the $'...' string is discarded, but anything remaining in the word is
processed, ie: aaa$'bbb\0ccc'ddd produces the same as aaa'bbb'ddd.

Differences from FreeBSD:
  FreeBSD allows only exactly 4 or 8 hex digits for \u and \U (as does C,
  but the current sh proposal differs.) reeBSD also continues consuming
  as many hex digits as exist after \x (permitted by the spec, but insane),
  and reject \u0000 as invalid).  Some of this is possibly because that
  their implementation is based upon an earlier proposal, perhaps note 590 -
  though that has been updated several times.

Differences from the current POSIX proposal:
  We currently always generate UTF-8 for the \u & \U escapes.   We should
  generate the equivalent character from the current locale's character set
  (and UTF8 only if that is what the current locale uses.)
  If anyone would like to correct that, go ahead.

  We (and FreeBSD) generate (X & 0x1F) for \cX escapes where we should generate
  the appropriate control character (SOH for \cA for example) with whatever
  value that has in the current character set.   Apart from EBCDIC, which
  we do not support, I've never seen a case where they differ, so ...
2017-08-21 13:20:49 +00:00
bin Add support for $'...' quoting (based upon C "..." strings, with \ expansions.) 2017-08-21 13:20:49 +00:00
common Fix ISO C compliance: strtol of "0xX" should give the largest valid 2017-07-06 21:08:44 +00:00
compat
crypto PR/51682: Antoine Beaupré: Simplify and comment previous patch. 2017-07-23 05:40:27 +00:00
dist/pf
distrib Create the ramdisk destination dir here. 2017-08-20 15:38:22 +00:00
doc Add previous statement from core@ and add reference to earlier E-mail 2017-08-21 10:38:19 +00:00
etc Creating installation/ramdisk here does not work; it happens too late. 2017-08-20 15:35:31 +00:00
external mp.h was removed a while ago. update the README to note this, and 2017-08-17 23:00:38 +00:00
extsrc
games typo 2017-07-02 07:02:47 +00:00
include Add missing strfmon_l. Noticed by Bruno Haible. Add test case. 2017-08-16 13:53:19 +00:00
lib Actually... s_nexttowardf.c appears to be usable on soft-float as well; 2017-08-17 13:58:39 +00:00
libexec Add sparc/sparc64 support for irelative relocations. 2017-08-12 09:03:27 +00:00
regress Remove the vm86 tests. 2017-08-12 07:40:43 +00:00
rescue Remove MKCRYPTO option. 2017-05-21 15:28:36 +00:00
sbin Use NULL instead of 0 for null pointer. 2017-08-07 22:08:12 +00:00
share Switch dreamcast to HAVE_XORG_SERVER_VER=118. It just works. 2017-08-16 13:53:54 +00:00
sys Change forced unmount to revert open device vnodes to anonymous devices. 2017-08-21 09:00:21 +00:00
tests Make the $'...' syntax tests test what is supposed to work, rather than 2017-08-21 00:56:22 +00:00
tools Update LLVM build glue for 5.0RC1. 2017-08-01 20:07:37 +00:00
usr.bin Use tcsh --version instead of an echo $version -- the old way did not 2017-08-20 10:17:55 +00:00
usr.sbin Add new function acpi_select_address() derived from acpi_get_fadt_revision(). 2017-08-21 02:58:49 +00:00
build.sh
BUILDING regen 2017-05-21 15:30:20 +00:00
Makefile don't descend into gnu 2017-04-11 14:04:15 +00:00
Makefile.inc
UPDATING add a note about MPC/MPFR updates breaking some types of update builds. 2017-08-17 01:16:55 +00:00