Commit Graph

179 Commits

Author SHA1 Message Date
joerg
56e0173839 Fix my breakage of the $0 handling during $ENV processing.
Since the broken version went into 2.1, this fix should, too.
1995-10-09 17:56:32 +00:00
joerg
c80589d3b0 Make the mkinit internal command issue an #undef for each #define, to
avoid "duplicate definition" warnings.
1995-10-01 15:13:31 +00:00
joerg
28020fbce3 Posixize:
sh  -c [-aCefinuvx] command_string [ command_name [argument ...]  ]        1

 4.56.3  Options

    -c          Read commands from the command_string operand.  Set the
                value of special parameter 0 (see 3.5.2) from the value of
                the command_name operand and the positional parameters
                ($1, $2, etc.) in sequence from the remaining argument
                operands.

Pointed out by: Kaleb Keithly (kaleb@x.org)
1995-10-01 15:11:42 +00:00
bde
639631b078 Fix relocation of job table.
while { sleep 1 & wait; } do echo 1; done

corrupted the job table every 4th iteration.
1995-09-21 13:24:20 +00:00
dg
299dbda765 Don't dereference a NULL pointer in the case of a null pipe.
e.g.:
ls |> foo.out

sh now behaves the same as it does under SunOS 4.x for this case.
1995-09-20 08:30:56 +00:00
joerg
1c542fcb27 Sigh. This will become a never ending story. :-(
When comparing my recent parser change against the ash in 1.1.5.1, i
found that a couple of other problems in the same area has been fixed
there, but not in 2.2.  Semicolons and EOF do also delimit words...
1995-08-28 19:24:35 +00:00
joerg
48a19ede59 Make the shell handle a null command in a &&/|| sequence correctly.
The && and || tokens do also terminate a command, not only the
newline.

While i was at it, disabled trace code by default, it served no good
purpose since it required the use of a debugger anyway to be turned
on.  Instead, placed a hint in the Makefile on how to turn it on.

This makes the shell ~ 10 % faster and ~ 4 KB smaller. :)

Pointed out by:  jan@physik.TU-Berlin.DE (Jan Riedinger)
1995-08-27 20:26:44 +00:00
pst
8bfad523d3 Clean up compilation warnings. 1995-08-23 05:31:06 +00:00
joerg
31f993e53f sh(1) incorrectly ignored an EOF condition when looking for the
closing backquote in a `foo` substitution.

Discovered by: Martin Welk <mw@theatre.pandora.sax.de>
1995-08-11 08:18:39 +00:00
joerg
756c4a7745 Fix /bin/sh's broken handling of the builtin getopts(1). The options
``-ffoo'' and ``-f foo'' have been treated differently.

This has been in violation of Posix.2 (that deprecates -ffoo, but
doesn't disallow it).
1995-08-06 19:35:33 +00:00
rgrimes
e6999472c1 Remove trailing whitespace.
Reviewed by:	phk
1995-05-30 00:07:29 +00:00
adam
a2f7d2cc4d typo there --> their 1995-05-05 16:49:15 +00:00
dg
619eb1f366 From "Philippe Charnier" <charnier@lirmm.fr>:
There is a bug in sh: the built in command "fc -l" generates
a core dump (*NULL in not_fcnumber).

According to the sh manual page (fc  -l [-nr] [first [last]]), fc -l
is a correct sequence (in that case, values are defaulted to -16 and -1)
but fails when first is not given.
1995-05-05 06:34:13 +00:00
phk
0eb056f264 Make build work, even if there is no obj subdir. 1995-03-30 19:45:20 +00:00
guido
5c7a36420c Fix the deletion of trailing newlines with backquote expansion.
Reviewed by:
Submitted by:
Obtained from:
1995-03-01 13:04:15 +00:00
paul
09db0d10a5 What I think is a more correct fix for the handling of backslashes
inside backquotes. Reversed my previous fix.
1995-01-11 07:07:00 +00:00
paul
a482d1e2b6 Fix a bug with handling backslash escapes inside some quotes.
Should solve our problems with edit-pr.
1995-01-09 20:00:54 +00:00
bde
b65d3e0ac9 Obtained from: partly from 1.1.5
Convert "" to "." for "cd" and "cd ''".  chdir("") is required to fail
on POSIX systems.
1994-12-26 13:02:05 +00:00
pst
b9dbcfa82f Add end of line check so mkinit doesn't produce garbage if you have a
MKINIT line that doesn't have a comment on it (we have at least two).

This mkinit program was written by someone who obviously doesn't believe
in defensive programming. :-(  There's a LOT of work that needs to be done
on this thing. :-( :-( :-(
1994-11-06 06:27:04 +00:00
jkh
663e17ac43 Get this braindead, mongoloid shell look in /stand for pwd if it can't
find it in /bin.  This is something of a kludge, I know, but consider
my limited alternatives:  I can't make this an execvp() without making
people scream that I introduced a failure point or slowed down pwd,
and I can't make it an optional macro since crunch doesn't let you pass
arbitrary command-line args to the build of one of its crunch-ees.
This is the simplest, if not the nicest looking, solution I could come up
with.
1994-11-06 01:29:26 +00:00
ache
fb5df4e7c6 libcompat removed 1994-10-02 01:36:03 +00:00
dg
00eb2a4dc0 Added $Id$ 1994-09-24 02:59:15 +00:00
sef
7064b94387 With '!' being made into a keyword (yech!), case cases didn't work properly.
This should fix it (passed my test cases).  Originally discovered with
perl's Configure (well, in FreeBSD, I don't know how the NetBSD folks
discovered it).

Reviewed by:	sef
Submitted by:	jtc@cygnus.com
Obtained from:	NetBSD
1994-09-14 17:41:32 +00:00
bde
b1f1422cba Add dependencies on libraries to DPADD. Someday this should be done
automagically.  -lfoo has to be right to work, but ${LIBFO0} is too
easy to forget or misspell; nothing checks it and it should be
different for shared libraries.
1994-08-28 18:49:06 +00:00
bde
b5cb754048 Touch init.c after making it in case mkinit refused to touch it after not
changing it.  mkinit's attempted smartness about timestamps is mismatched
with the makefile.  init.o is compiled _twice_ the first time it is made...
1994-08-21 10:44:51 +00:00
dg
a523463cf1 Got rid of stupid warning message. 1994-08-18 14:35:23 +00:00
rgrimes
b8dbcb3015 Need ${LDFLAGS} one more place. 1994-05-30 13:59:50 +00:00
rgrimes
98c9ded959 Need to sue ${LDFLAGS} when building local binaries so they get built
static if ${NOSHARED}==YES.  This makes it easier to bootstrap a system.
1994-05-29 12:43:06 +00:00
rgrimes
e3cfc8ce61 BSD 4.4 Lite bin Sources 1994-05-26 06:18:55 +00:00