Commit Graph

27 Commits

Author SHA1 Message Date
christos 51457e8842 Make sure that UPEOF is compared to the right type on the left hand
side. Sometimes it was compared to int, which was -1 on EOF, and on
unsigned char machines UPEOF was (unsigned char)-1. This worked
by chance because isalpha((unsigned char)-1) returns false usually,
but it does not when the locale is invalid!
2003-01-12 20:26:53 +00:00
christos c02b3bbdf4 Fixes from David Laight:
- ansification
- format of output of jobs command (etc)
- job identiers %+, %- etc
- $? and $(...)
- correct quoting of output of set, export -p and readonly -p
- differentiation between nornal and 'posix special' builtins
- correct behaviour (posix) for errors on builtins and special builtins
- builtin printf and kill
- set -o debug (if compiled with DEBUG)
- cd src obj (as ksh - too useful to do without)
- unset -e name, remove non-readonly variable from export list.
  (so I could unset -e PS1 before running the test shell...)
2002-11-24 22:35:38 +00:00
christos 82886e162e deal with char c; c != -129 warning. Hi jason! 2002-05-31 16:18:48 +00:00
christos 6c02afd8c4 Since we should be able to handle nested double quotes, don't use
the syntax maps to determine the beginning and end quotes (kill
CENDQUOTE).  Handle single quotes opening and closing via checking
the current syntax map. Keep a bitmap of doublequote state one bit
per variable nesting level.  For the first 32 nested double quotes,
we don't need any additional memory, but for more we allocate
dynamically.
2002-02-12 20:32:35 +00:00
cgd 28728fd305 host program portability: don't use <sys/cdefs.h>, __COPYRIGHT(),
__RCSID(), or __P().  (these programs have been de-__P()'d.)
Repeat after me: "Not all cross-compilation host systems are NetBSD."
2000-07-18 19:13:20 +00:00
castor dc67d78474 Add '#include <sys/types.h>' since that's where int8_t and u_int8_t can
usually be found.
1999-03-08 17:55:20 +00:00
wrstuden 6790f70d78 Make cross-building from i386 to powerpc (from signed to unsigned char)
ports work right.
1999-02-23 01:50:26 +00:00
mycroft 1fbf0781c6 Patches from Tor Egge (via Havard Eidnes) to fix various bugs in field
splitting and combining.
(Note: Some of this are not strictly bugs, but differences between traditional
Bourne shell and POSIX.)
1999-01-25 14:20:56 +00:00
wrstuden d10063d5c7 Patch to make sh cross-compile right. mksyntax reports unsigned char for
powerpc, and signed for m68k & i386.
1998-09-12 18:55:07 +00:00
mycroft ee9e50eacb Be more retentive about use of NOTREACHED and noreturn. 1998-07-28 11:41:40 +00:00
mycroft 9dc385beb1 Delint. 1998-07-28 05:31:22 +00:00
thorpej d891aff808 Cast the result of pointer arithmetic to "long", and use %ld to print it. 1997-07-18 17:46:59 +00:00
christos 5accccd051 Fix problem introduced in yesterday's commit that broke both signed and
unsigned character machines. So that people don't have to reverse engineer
this again:
	mksyntax detects if characters are signed or not and builts a syntax
	table that has a base of 129 for signed characters or 1 for unsigned
	characters. This is so the largest negative signed char [-128] + the
	base == 1. 0 is special and means end of file in both cases. PEOF
	is -1 for the unsigned character case and -129 for the signed
	character case, so that syntax[PEOF + base] == syntax[0] == CEOF
	So PEOF has to be -1, but it is explicitly compared with
	unsigned characters on machines where characters are unsigned.
	The quick fix is to define UPEOF the (unsigned char) version of PEOF
	and use that. A better fix is to always use unsigned characters
	when referencing symbol table entries, but that would require
	extensive changes to the shell. So to summarize

	syntax[0] == CEOF, base + PEOF == 0

		unsigned	signed
	base	1		129
	PEOF	-1		-129
1997-07-05 21:25:09 +00:00
christos 687f7852d9 Make the syntax tables work on machines where characters are unsigned. 1997-07-04 21:40:55 +00:00
christos cd799663e4 Fix compiler warnings. 1997-07-04 21:01:48 +00:00
christos 03ba3cf0d6 PR/2808: Use the <ctype.h> functions instead of our homegrown tables to
determine if a character is alpha or alphanumeric, so that NLS
	 works... now if only our NLS really worked... (from FreeBSD).
1996-10-16 14:46:35 +00:00
christos 07bae7eddd Merge in my changes from vangogh, and fix the x=`false`; echo $? == 0
bug.
1995-05-11 21:28:33 +00:00
cgd 49f0ad8601 convert to new RCS id conventions. 1995-03-21 09:01:59 +00:00
cgd 17ed2a67b2 pull some prototypes into scope. 1994-12-23 13:22:13 +00:00
cgd 5dad143982 from James Jegers <jimj@miller.cs.uwm.edu>: quiet -Wall, and squelch
some of the worst style errors.
1994-12-04 07:11:37 +00:00
jtc 918ce04f57 From Christos:
1. Fix `-' quoting in [ ] expressions.
  2. Fix expansion of variables in redirections
1994-06-14 05:49:19 +00:00
mycroft cafd1f7e9f Add RCS ids. 1994-06-11 16:11:35 +00:00
jtc 37ed7877b2 sync with 4.4lite 1994-05-11 17:09:42 +00:00
mycroft 8542364e07 Add RCS identifiers. 1993-08-01 18:49:50 +00:00
cgd 06be60083d changed "Id" to "Header" for rcsids 1993-03-23 00:22:59 +00:00
cgd 346aa5dd48 added rcs ids to all files 1993-03-22 08:04:00 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00