The NetBSD Project

CVS log for src/bin/sh/histedit.c

[BACK] Up to [cvs.NetBSD.org] / src / bin / sh

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.65 / (download) - annotate - [select for diffs], Mon Aug 22 17:33:11 2022 UTC (5 months, 1 week ago) by kre
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, HEAD
Changes since 1.64: +42 -3 lines
Diff to previous 1.64 (colored)


Add debugging trace points for history and the editline interface.
NFC for any normal shell (not compiled with debugging (sh DEBUG) enabled.

We have had a defined debug mode for this for years, but since I have
not often played in this arena, never used it.  Until recently (relatively).
This (or a small part of it) played a part in discovering the fc -e
bug cause.   I have had it in my tree a while now - recent changes
kept causing merge conflicts (all because I hadn't bothered to commit
this), so I think now is the time...

Revision 1.64 / (download) - annotate - [select for diffs], Sun Aug 21 21:35:36 2022 UTC (5 months, 1 week ago) by nia
Branch: MAIN
Changes since 1.63: +1 -1 lines
Diff to previous 1.63 (colored)

sh(1): revert previous because it interferes with custom user bindings

Revision 1.63 / (download) - annotate - [select for diffs], Thu Aug 18 14:10:05 2022 UTC (5 months, 2 weeks ago) by nia
Branch: MAIN
Changes since 1.62: +3 -3 lines
Diff to previous 1.62 (colored)

sh(1): Allow an explicit set -o vi or set -o emacs to override ~/.editrc

Revision 1.62 / (download) - annotate - [select for diffs], Wed Aug 17 22:27:17 2022 UTC (5 months, 2 weeks ago) by nia
Branch: MAIN
Changes since 1.61: +3 -3 lines
Diff to previous 1.61 (colored)

sh(1): Assign the tab completion key binding last so a user having
"bind -v" or "bind -e" in ~/.editrc doesn't cause tab completion
to no longer function.

Revision 1.48.8.3 / (download) - annotate - [select for diffs], Thu Feb 24 10:07:46 2022 UTC (11 months, 1 week ago) by martin
Branch: netbsd-8
Changes since 1.48.8.2: +3 -3 lines
Diff to previous 1.48.8.2 (colored) to branchpoint 1.48 (colored) next main 1.49 (colored)

Pull up following revision(s) (requested by kre in ticket #1736):

	bin/sh/histedit.c: revision 1.60

After (a few days short of) 21 years, revert 1.25, which did nothing except
make the -e option to "fc" fail to work (the commit message was about some
other changes entirely, so I an only assume this was committed by mistake).

It says a lot about the use of the fc command that no-one noticed that
this did not work properly for all this time.

Internally in sh, it is possible for built in commands to use either
getopt(3) (from libc) or the much simpler internal shell nextopt() routine
for option (flag) parsing.    However it makes no sense to use getopt()
and then access a global variable set only by nextopt() instead of the
one getopt() sets (which is what the code had used previously, forever).

Use the correct variable again.

XXX pullup -9 -8  (-7 -6 -5 ...)

Revision 1.55.2.1 / (download) - annotate - [select for diffs], Mon Feb 21 17:58:11 2022 UTC (11 months, 1 week ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE
Changes since 1.55: +3 -3 lines
Diff to previous 1.55 (colored) next main 1.56 (colored)

Pull up following revision(s) (requested by kre in ticket #1429):

	bin/sh/histedit.c: revision 1.60

After (a few days short of) 21 years, revert 1.25, which did nothing except
make the -e option to "fc" fail to work (the commit message was about some
other changes entirely, so I an only assume this was committed by mistake).

It says a lot about the use of the fc command that no-one noticed that
this did not work properly for all this time.

Internally in sh, it is possible for built in commands to use either
getopt(3) (from libc) or the much simpler internal shell nextopt() routine
for option (flag) parsing.    However it makes no sense to use getopt()
and then access a global variable set only by nextopt() instead of the
one getopt() sets (which is what the code had used previously, forever).

Use the correct variable again.

XXX pullup -9 -8  (-7 -6 -5 ...)

Revision 1.61 / (download) - annotate - [select for diffs], Tue Feb 8 20:39:59 2022 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.60: +3 -3 lines
Diff to previous 1.60 (colored)

sh: fix typo in comment

Revision 1.60 / (download) - annotate - [select for diffs], Wed Feb 2 01:21:34 2022 UTC (11 months, 4 weeks ago) by kre
Branch: MAIN
Changes since 1.59: +3 -3 lines
Diff to previous 1.59 (colored)

After (a few days short of) 21 years, revert 1.25, which did nothing except
make the -e option to "fc" fail to work (the commit message was about some
other changes entirely, so I an only assume this was committed by mistake).

It says a lot about the use of the fc command that no-one noticed that
this did not work properly for all this time.

Internally in sh, it is possible for built in commands to use either
getopt(3) (from libc) or the much simpler internal shell nextopt() routine
for option (flag) parsing.    However it makes no sense to use getopt()
and then access a global variable set only by nextopt() instead of the
one getopt() sets (which is what the code had used previously, forever).

Use the correct variable again.

XXX pullup -9 -8  (-7 -6 -5 ...)

Revision 1.59 / (download) - annotate - [select for diffs], Mon Jan 31 18:15:45 2022 UTC (12 months ago) by kre
Branch: MAIN
Changes since 1.58: +4 -7 lines
Diff to previous 1.58 (colored)


When we initialize libedit (editline) always call ourselves "sh" no
matter what $0 is (or is not) set to.   This means that editrc(5)
lines that start "sh:" are used (in addition to those with no prefix,
which will usually be most of them), regardless of the name or manner in
which we were invoked.

OK christos@

Revision 1.58 / (download) - annotate - [select for diffs], Mon Jan 31 16:54:28 2022 UTC (12 months ago) by kre
Branch: MAIN
Changes since 1.57: +19 -2 lines
Diff to previous 1.57 (colored)


Add some comments explaining accesses to the environment via
getenv()/setenv()/unsetenv() which manipulate the envornoment
the shell was passed at entry.

These are a little odd in sh as that environment is copied into
the shell's internal variable data struct at shell startup, and
normally never accessed after that - in builtin commands (test.
printf, ...) getenv() is #defined to become an internal sh lookup
function instead, so even those never use the startup environment).

NFCI

Revision 1.57 / (download) - annotate - [select for diffs], Tue Sep 14 15:04:09 2021 UTC (16 months, 2 weeks ago) by christos
Branch: MAIN
Changes since 1.56: +4 -4 lines
Diff to previous 1.56 (colored)

Quote the filenames like before

Revision 1.56 / (download) - annotate - [select for diffs], Sun Aug 15 10:17:55 2021 UTC (17 months, 2 weeks ago) by christos
Branch: MAIN
Changes since 1.55: +124 -12 lines
Diff to previous 1.55 (colored)

- Add command completion (from FreeBSD)
- Use EL_SAFEREAD

Revision 1.52.6.3 / (download) - annotate - [select for diffs], Tue Apr 21 19:37:34 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.52.6.2: +2 -2 lines
Diff to previous 1.52.6.2 (colored) to branchpoint 1.52 (colored) next main 1.53 (colored)

Ooops, restore accidently removed files from merge mishap

Revision 1.52.6.2, Tue Apr 21 18:41:06 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.52.6.1: +2 -2 lines
FILE REMOVED

Sync with HEAD

Revision 1.52.6.1 / (download) - annotate - [select for diffs], Mon Jun 10 21:41:03 2019 UTC (3 years, 7 months ago) by christos
Branch: phil-wifi
Changes since 1.52: +22 -9 lines
Diff to previous 1.52 (colored)

Sync with HEAD

Revision 1.55 / (download) - annotate - [select for diffs], Sun Feb 10 19:21:52 2019 UTC (3 years, 11 months ago) by kre
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, netbsd-9-base, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Branch point for: netbsd-9
Changes since 1.54: +2 -3 lines
Diff to previous 1.54 (colored)


Remove a function prototype which was added to <histedit.h> in 2005.
I think we can trust it to be stable by now, and doin't need the dup.

Revision 1.54 / (download) - annotate - [select for diffs], Sat Feb 9 03:35:55 2019 UTC (3 years, 11 months ago) by kre
Branch: MAIN
Changes since 1.53: +19 -5 lines
Diff to previous 1.53 (colored)


INTON / INTOFF audit and cleanup.

No visible differences expected - there is a remote chance that
some internal lossage may no longer occur in interactive shells
that receive SIGINT (untrapped) at inopportune times, but you would
have had to have been very unlucky to have ever suffered from that.

Revision 1.48.8.2 / (download) - annotate - [select for diffs], Sat Aug 25 14:45:37 2018 UTC (4 years, 5 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1
Changes since 1.48.8.1: +5 -5 lines
Diff to previous 1.48.8.1 (colored) to branchpoint 1.48 (colored)

Pull up following revision(s) (requested by kre in ticket #988):

	bin/sh/parser.c: revision 1.147
	bin/sh/var.c: revision 1.70
	bin/sh/mystring.c: revision 1.18
	bin/sh/options.c: revision 1.53
	bin/sh/histedit.c: revision 1.53

Remove atoi()

Mostly use number() (no longer implemented using atoi()) when an
unsigned integer is required, but use strtoXXX() when a conversion
is wanted, without the possibility or error (like setting OPTIND
and RANDOM).   Always init OPTIND to 1 when sh starts (overriding
anything in environ.)

Revision 1.52.4.1 / (download) - annotate - [select for diffs], Sat Jul 28 04:32:56 2018 UTC (4 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.52: +5 -5 lines
Diff to previous 1.52 (colored) next main 1.53 (colored)

Sync with HEAD

Revision 1.53 / (download) - annotate - [select for diffs], Fri Jul 13 22:43:44 2018 UTC (4 years, 6 months ago) by kre
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728
Changes since 1.52: +5 -5 lines
Diff to previous 1.52 (colored)

Remove atoi()

Mostly use number() (no longer implemented using atoi()) when an
unsigned integer is required, but use strtoXXX() when a conversion
is wanted, without the possibility or error (like setting OPTIND
and RANDOM).   Always init OPTIND to 1 when sh starts (overriding
anything in environ.)

Revision 1.48.8.1 / (download) - annotate - [select for diffs], Sun Jul 23 14:58:14 2017 UTC (5 years, 6 months ago) by snj
Branch: netbsd-8
CVS Tags: netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, matt-nb8-mediatek-base, matt-nb8-mediatek
Changes since 1.48: +32 -4 lines
Diff to previous 1.48 (colored)

Pull up following revision(s) (requested by kre in ticket #103):
	bin/kill/kill.c: 1.28
	bin/sh/Makefile: 1.111-1.113
	bin/sh/arith_token.c: 1.5
	bin/sh/arith_tokens.h: 1.2
	bin/sh/arithmetic.c: 1.3
	bin/sh/arithmetic.h: 1.2
	bin/sh/bltin/bltin.h: 1.15
	bin/sh/cd.c: 1.49-1.50
	bin/sh/error.c: 1.40
	bin/sh/eval.c: 1.142-1.151
	bin/sh/exec.c: 1.49-1.51
	bin/sh/exec.h: 1.26
	bin/sh/expand.c: 1.113-1.119
	bin/sh/expand.h: 1.23
	bin/sh/histedit.c: 1.49-1.52
	bin/sh/input.c: 1.57-1.60
	bin/sh/input.h: 1.19-1.20
	bin/sh/jobs.c: 1.86-1.87
	bin/sh/main.c: 1.71-1.72
	bin/sh/memalloc.c: 1.30
	bin/sh/memalloc.h: 1.17
	bin/sh/mknodenames.sh: 1.4
	bin/sh/mkoptions.sh: 1.3-1.4
	bin/sh/myhistedit.h: 1.12-1.13
	bin/sh/nodetypes: 1.16-1.18
	bin/sh/option.list: 1.3-1.5
	bin/sh/parser.c: 1.133-1.141
	bin/sh/parser.h: 1.22-1.23
	bin/sh/redir.c: 1.58
	bin/sh/redir.h: 1.24
	bin/sh/sh.1: 1.149-1.159
	bin/sh/shell.h: 1.24
	bin/sh/show.c: 1.43-1.47
	bin/sh/show.h: 1.11
	bin/sh/syntax.c: 1.4
	bin/sh/syntax.h: 1.8
	bin/sh/trap.c: 1.41
	bin/sh/var.c: 1.56-1.65
	bin/sh/var.h: 1.29-1.35
An initial attempt at implementing LINENO to meet the specs.
Aside from one problem (not too hard to fix if it was ever needed) this version
does about as well as most other shell implementations when expanding
$((LINENO)) and better for ${LINENO} as it retains the "LINENO hack" for the
latter, and that is very accurate.
Unfortunately that means that ${LINENO} and $((LINENO)) do not always produce
the same value when used on the same line (a defect that other shells do not
share - aside from the FreeBSD sh as it is today, where only the LINENO hack
exists and so (like for us before this commit) $((LINENO)) is always either
0, or at least whatever value was last set, perhaps by
	LINENO=${LINENO}
which does actually work ... for that one line...)
This could be corrected by simply removing the LINENO hack (look for the string
LINENO in parser.c) in which case ${LINENO} and $((LINENO)) would give the
same (not perfectly accurate) values, as do most other shells.
POSIX requires that LINENO be set before each command, and this implementation
does that fairly literally - except that we only bother before the commands
which actually expand words (for, case and simple commands).   Unfortunately
this forgot that expansions also occur in redirects, and the other compound
commands can also have redirects, so if a redirect on one of the other compound
commands wants to use the value of $((LINENO)) as a part of a generated file
name, then it will get an incorrect value.  This is the "one problem" above.
(Because the LINENO hack is still enabled, using ${LINENO} works.)
This could be fixed, but as this version of the LINENO implementation is just
for reference purposes (it will be superseded within minutes by a better one)
I won't bother.  However should anyone else decide that this is a better choice
(it is probably a smaller implementation, in terms of code & data space then
the replacement, but also I would expect, slower, and definitely less accurate)
this defect is something to bear in mind, and fix.
This version retains the *BSD historical practice that line numbers in functions
(all functions) count from 1 from the start of the function, and elsewhere,
start from 1 from where the shell started reading the input file/stream in
question.  In an "eval" expression the line number starts at the line of the
"eval" (and then increases if the input is a multi-line string).
Note: this version is not documented (beyond as much as LINENO was before)
hence this slightly longer than usual commit message.
A better LINENO implementation.   This version deletes (well, #if 0's out)
the LINENO hack, and uses the LINENO var for both ${LINENO} and $((LINENO)).
(Code to invert the LINENO hack when required, like when de-compiling the
execution tree to provide the "jobs" command strings, is still included,
that can be deleted when the LINENO hack is completely removed - look for
refs to VSLINENO throughout the code.  The var funclinno in parser.c can
also be removed, it is used only for the LINENO hack.)
This version produces accurate results: $((LINENO)) was made as accurate
as the LINENO hack made ${LINENO} which is very good.  That's why the
LINENO hack is not yet completely removed, so it can be easily re-enabled.
If you can tell the difference when it is in use, or not in use, then
something has broken (or I managed to miss a case somewhere.)
The way that LINENO works is documented in its own (new) section in the
man page, so nothing more about that, or the new options, etc, here.
This version introduces the possibility of having a "reference" function
associated with a variable, which gets called whenever the value of the
variable is required (that's what implements LINENO).  There is just
one function pointer however, so any particular variable gets at most
one of the set function (as used for PATH, etc) or the reference function.
The VFUNCREF bit in the var flags indicates which func the variable in
question uses (if any - the func ptr, as before, can be NULL).
I would not call the results of this perfect yet, but it is close.
Unbreak (at least) i386 build .... I have no idea why this built for me on
amd64 (problem was missing prototype for snprintf witout <stdio.h>)
While here, add some (DEBUG mode only) tracing that proved useful in
solving another problem.
Set the line number before expanding args, not after.   As the line_number
would have usually been set earlier, this change is mostly an effective
no-op, but it is better this way (just in case) - not observed to have
caused any problems.
Undo some over agressive fixes for a (pre-commit) bug that did not
need these changes to be fixed - and these cause problems in another
absurd use case.   Either of these issues is unlikely to be seen by
anyone who isn't an idiot masochist...
PR bin/52280
removescapes_nl in expari() even when not quoted,
CRTNONL's appear regardless of quoting (unlike CTLESC).
New sentence, new line. Whitespace.
Improve the (new) LINENO section, markup changes (with thanks to wiz@ for
assistace) and some better wording in a few placed.
I am an idiot...  revert the previous unintended commit.
Remove some left over baggage from the LINENO v1 implementation that
didn't get removed with v2, and should have.   This would have had
(I think, without having tested it) one very minor effect on the way
LINENO worked in the v2 implementation, but my guess is it would have
taken a long time before anyone noticed...
Correct spelling in comments of DEBUG only code...
(Perhaps) temporary fix to pkgtools (cwrappers) build (configure).
Expanding  `` containing \ \n sequences looks to have been giving
problems.   I don't think this is the correct fix, but it will do
no worse harm than (perhaps) incorrectly calculating LINENO in this
kind of (rare) circumstance.   I'll look and see if there should be
a better fix later.
s/volatile/const/ -- wonderful how opposites attract like this.
NFC (normal use) - DEBUG only change, when showing empty arg list don't
omit terminating \n.
Free stack memory in a couple of obscure cases where it wasn't
being done (one in probably dead code that is never compiled, the other
in a very rare error case.)   Since it is stack memory it wasn't lost
in any case, just held longer than needed.
Many internal memory management type fixes.
PR bin/52302   (core dump with interactive shell, here doc and error
on same line) is fixed.   (An old bug.)
echo "$( echo x; for a in $( seq 1000 ); do printf '%s\n'; done; echo y )"
consistently prints 1002 lines (x, 1000 empty ones, then y) as it should
(And you don't want to know what it did before, or why.) (Another old one.)
(Recently added) Problems with ~ expansion fixed (mem management related).
Proper fix for the cwrappers configure problem (which includes the quick
fix that was done earlier, but extends upon that to be correct). (This was
another newly added problem.)
And the really devious (and rare) old bug - if STACKSTRNUL() needs to
allocate a new buffer in which to store the \0, calculate the size of
the string space remaining correctly, unlike when SPUTC() grows the
buffer, there is no actual data being stored in the STACKSTRNUL()
case - the string space remaining was calculated as one byte too few.
That would be harmless, unless the next buffer also filled, in which
case it was assumed that it was really full, not one byte less, meaning
one junk char (a nul, or anything) was being copied into the next (even
bigger buffer) corrupting the data.
Consistent use of stalloc() to allocate a new block of (stack) memory,
and grabstackstr() to claim a block of (stack) memory that had already
been occupied but not claimed as in use.  Since grabstackstr is implemented
as just a call to stalloc() this is a no-op change in practice, but makes
it much easier to comprehend what is really happening.  Previous code
sometimes used stalloc() when the use case was really for grabstackstr().
Change grabstackstr() to actually use the arg passed to it, instead of
(not much better than) guessing how much space to claim,
More care when using unstalloc()/ungrabstackstr() to return space, and in
particular when the stack must be returned to its previous state, rather than
just returning no-longer needed space, neither of those work.  They also don't
work properly if there have been (really, even might have been) any stack mem
allocations since the last stalloc()/grabstackstr().   (If we know there
cannot have been then the alloc/release sequence is kind of pointless.)
To work correctly in general we must use setstackmark()/popstackmark() so
do that when needed.  Have those also save/restore the top of stack string
space remaining.
	[Aside: for those reading this, the "stack" mentioned is not
	in any way related to the thing used for maintaining the C
	function call state, ie: the "stack segment" of the program,
	but the shell's internal memory management strategy.]
More comments to better explain what is happening in some cases.
Also cleaned up some hopelessly broken DEBUG mode data that were
recently added (no effect on anyone but the poor semi-human attempting
to make sense of it...).
User visible changes:
Proper counting of line numbers when a here document is delimited
by a multi-line end-delimiter, as in
	cat << 'REALLY
	END'
	here doc line 1
	here doc line 2
	REALLY
	END
(which is an obscure case, but nothing says should not work.)  The \n
in the end-delimiter of the here doc (the last one) was not incrementing
the line number, which from that point on in the script would be 1 too
low (or more, for end-delimiters with more than one \n in them.)
With tilde expansion:
	unset HOME; echo ~
changed to return getpwuid(getuid())->pw_home instead of failing (returning ~)
POSIX says this is unspecified, which makes it difficult for a script to
compensate for being run without HOME set (as in env -i sh script), so
while not able to be used portably, this seems like a useful extension
(and is implemented the same way by some other shells).
Further, with
	HOME=; printf %s ~
we now write nothing (which is required by POSIX - which requires ~ to
expand to the value of $HOME if it is set) previously if $HOME (in this
case) or a user's directory in the passwd file (for ~user) were a null
STRING, We failed the ~ expansion and left behind '~' or '~user'.
Changed the long name for the -L option from lineno_fn_relative
to local_lineno as the latter seemed to be marginally more popular,
and perhaps more importantly, is the same length as the peviously
existing quietprofile option, which means the man page indentation
for the list of options can return to (about) what it was before...
(That is, less indented, which means more data/line, which means less
lines of man page - a good thing!)
Cosmetic changes to variable flags - make their values more suited
to my delicate sensibilities...  (NFC).
Arrange not to barf (ever) if some turkey makes _ readonly.  Do this
by adding a VNOERROR flag that causes errors in var setting to be
ignored (intended use is only for internal shell var setting, like of "_").
(nb: invalid var name errors ignore this flag, but those should never
occur on a var set by the shell itself.)
From FreeBSD: don't simply discard memory if a variable is not set for
any reason (including because it is readonly) if the var's value had
been malloc'd.  Free it instead...
NFC - DEBUG changes, update this to new TRACE method.
KNF - white space and comment formatting.
NFC - DEBUG mode only change - convert this to the new TRACE() format.
NFC - DEBUG mode only change - complete a change made earlier (marking
the line number when included in the trace line tag to show whether it
comes from the parser, or the elsewhere as they tend to be quite different).
Initially only one case was changed, while I pondered whether I liked it
or not.  Now it is all done...   Also when there is a line tag at all,
always include the root/sub-shell indicator character, not only when the
pid is included.
NFC: DEBUG related comment change - catch up with reality.
NFC: DEBUG mode only change.  Fix botched cleanup of one TRACE().
"b" more forgiving when sorting options to allow reasonable (and intended)
flexibility in option.list format.   Changes nothing for current option.list.
Now that excessive use of STACKSTRNUL has served its purpose (well, accidental
purpose) in exposing the bug in its implementation, go back to not using
it when not needed for DEBUG TRACE purposes.   This change should have no
practical effect on either a DEBUG shell (where the STACKSTRNUL() calls
remain) or a non DEBUG shell where they are not needed.
Correct the initial line number used for processing -c arg strings.
(It was inheriting the value from end of profile file processing) - I didn't
notice before as I usually test with empty or no profile files to avoid
complications.   Trivial change which should have very limited impact.
Fix from FreeBSD (applied there in July 2008...)
Don't dump core with input like sh -c 'x=; echo >&$x' - that is where
the word after a >& or <& redirect expands to nothing at all.
Another fix from FreeBSD (this one from April 2009).
When processing a string (as in eval, trap, or sh -c) don't allow
trailing \n's to destroy the exit status of the last command executed.
That is:
	sh -c 'false
	'
	echo $?
should produce 1, not 0.
It is amazing what nonsense appears to work sometimes... (all my nonsense too!)
Two bugs here, one benign because of the way the script is used.
The other hidden by NetBSD's sort being stable, and the data not really
requiring sorting at all...
So as it happens these fixes change nothing, but they are needed anyway.
(The contents of the generated file are only used in DEBUG shells, so
this is really even less important than it seems.)
Another ancient (highly improbable) bug bites the dust.   This one
caused by incorrect macro usage (ie: using the wrong one) which has
been in the sources since version 1.1 (ie: forever).
Like the previous (STACKSTRNUL) bug, the probability of this one
actually occurring has been infinitesimal but the LINENO code increases
that to infinitesimal and a smidgen... (or a few, depending upon usage).
Still, apparently that was enough, Kamil Rytarowski discovered that the
zsh configure script (damn competition!) managed to trigger this problem.
source .editrc after we initialize so that commands persist!
Make arg parsing in kill POSIX compatible with POSIX (XBD 2.12) by
parsing the way getopt(3) would, if only it could handle the (required)
-signumber and -signame options.  This adds two "features" to kill,
-ssigname and -lstatus now work (ie: one word with all of the '-', the
option letter, and its value) and "--" also now works (kill -- -pid1 pid2
will not attempt to send the pid1 signal to pid2, but rather SIGTERM
to the pid1 process group and pid2).  It is still the case that (apart
from --) at most 1 option is permitted (-l, -s, -signame, or -signumber.)
Note that we now have an ambiguity, -sname might mean "-s name" or
send the signal "sname" - if one of those turns out to be valid, that
will be accepted, otherwise the error message will indicate that "sname"
is not a valid signal name, not that "name" is not.   Keeping the "-s"
and signal name as separate words avoids this issue.
Also caution: should someone be weird enough to define a new signal
name (as in the part after SIG) which is almost the same name as an
existing name that starts with 'S' by adding an extra 'S' prepended
(eg: adding a SIGSSYS) then the ambiguity problem becomes much worse.
In that case "kill -ssys" will be resolved in favour of the "-s"
flag being used (the more modern syntax) and would send a SIGSYS, rather
that a SIGSSYS.    So don't do that.
While here, switch to using signalname(3) (bye bye NSIG, et. al.), add
some constipation, and show a little pride in formatting the signal names
for "kill -l" (and in the usage when appropriate -- same routine.)   Respect
COLUMNS (POSIX XBD 8.3) as primary specification of the width (terminal width,
not number of columns to print) for kill -l, a very small value for COLUMNS
will cause kill -l output to list signals one per line, a very large
value will cause them all to be listed on one line.) (eg: "COLUMNS=1 kill -l")
TODO: the signal printing for "trap -l" and that for "kill -l"
should be switched to use a common routine (for the sh builtin versions.)
All changes of relevance here are to bin/kill - the (minor) changes to bin/sh
are only to properly expose the builtin version of getenv(3) so the builtin
version of kill can use it (ie: make its prototype available.)
Properly support EDITRC - use it as (naming) the file when setting
up libedit, and re-do the config whenever EDITRC is set.
Get rid of workarounds for ancient groff html backend.
Simplify macro usage.
Make one example more like a real world possibility (it still isn't, but
is closer) - though the actual content is irrelevant to the point being made.
Add literal prompt support this allows one to do:
CA="$(printf '\1')"
PS1="${CA}$(tput bold)${CA}\$${CA}$(tput sgr0)${CA} "
Now libedit supports embedded mode switch sequence, improve sh
support for them (adds PSlit variable to set the magic character).
NFC: DEBUG only change - provide an externally visible (to the DEBUG sh
internals) interface to one of the internal (private to trace code) functions
Include redirections in trace output from "set -x"
Implement PS1, PS2 and PS4 expansions (variable expansions, arithmetic
expansions, and if enabled by the promptcmds option, command substitutions.)
Implement a bunch of new shell environment variables. many mostly useful
in prompts when expanded at prompt time, but all available for general use.
Many of the new ones are not available in SMALL shells (they work as normal
if assigned, but the shell does not set or use them - and there is no magic
in a SMALL shell (usually for install media.))
Omnibus manual update for prompt expansions and new variables.  Throw in
some random cleanups as a bonus.
Correct a markup typo (why did I not see this before the prev commit??)
Sort options (our default is 0..9AaBbZz).
Fix markup problems and a typo.
Make $- list flags in the same order they appear in sh(1)
Do a better job of detecting the error in pkgsrc/devel/libbson-1.6.3's
configure script, ie: $(( which is intended to be a sub-shell in a
command substitution, but is an arith subst instead, it needs to be
written $( ( to do as intended.   Instead of just blindly carrying on to
find the missing )) somewhere, anywhere, give up as soon as we have seen
an unbalanced ')' that isn't immediately followed by another ')' which
in a valid arith subst it always would be.
While here, there has been a comment in the code for quite a while noting a
difference in the standard between the text descr & grammar when it comes to
the syntax of case statements.   Add more comments to explain why parsing it
as we do is in fact definitely the correct way (ie: the grammar wins arguments
like this...).
DEBUG and white space changes only.   Convert TRACE() calls for DEBUg mode
to the new style.   NFC (when not debugging sh).
Mostly DEBUG and white space changes.   Convert DEEBUG TRACE() calls to
the new format.   Also #if 0 a function definition that is used nowhere.
While here, change the function of pushfile() slightly - it now sets
the buf pointer in the top (new) input descriptor to NULL, instead of
simply leaving it - code that needs a buffer always (before and after)
must malloc() one and assign it after the call.  But code which does not
(which will be reading from a string or similar) now does not have to
explicitly set it to NULL (cleaner interface.)   NFC intended (or observed.)
DEBUG changes: convert DEBUG TRACE() calls to new format.
ALso, cause exec failures to always cause the shell to exit with
status 126 or 127, whatever the cause.  127 is intended for lookup
failures (and is used that way), 126 is used for anything else that
goes wrong (as in several other shells.)  We no longer use 2 (more easily
confused with an exit status of the command exec'd) for shell exec failures.
DEBUG only changes.  Convert the TRACE() calls in the remaining files
that still used it to the new format.   NFC.
Fix a reference after free (and consequent nonsense diagnostic for
attempts to set readonly variables) I added in 1.60 by incompletely
copying the FreeBSD fix for the lost memory issue.

Revision 1.52 / (download) - annotate - [select for diffs], Wed Jun 28 13:46:06 2017 UTC (5 years, 7 months ago) by kre
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-base, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, perseant-stdc-iso10646-base, perseant-stdc-iso10646
Branch point for: phil-wifi, pgoyette-compat
Changes since 1.51: +25 -3 lines
Diff to previous 1.51 (colored)


Now libedit supports embedded mode switch sequence, improve sh
support for them (adds PSlit variable to set the magic character).

Revision 1.51 / (download) - annotate - [select for diffs], Tue Jun 27 23:27:03 2017 UTC (5 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.50: +3 -3 lines
Diff to previous 1.50 (colored)

Add literal prompt support this allows one to do:
CA="$(printf '\1')"
PS1="${CA}$(tput bold)${CA}\$${CA}$(tput sgr0)${CA} "

Revision 1.50 / (download) - annotate - [select for diffs], Tue Jun 27 02:22:08 2017 UTC (5 years, 7 months ago) by kre
Branch: MAIN
Changes since 1.49: +9 -3 lines
Diff to previous 1.49 (colored)


Properly support EDITRC - use it as (naming) the file when setting
up libedit, and re-do the config whenever EDITRC is set.

Revision 1.49 / (download) - annotate - [select for diffs], Mon Jun 26 20:28:01 2017 UTC (5 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.48: +3 -3 lines
Diff to previous 1.48 (colored)

source .editrc after we initialize so that commands persist!

Revision 1.48 / (download) - annotate - [select for diffs], Wed Mar 16 22:36:40 2016 UTC (6 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, netbsd-8-base, localcount-20160914, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: netbsd-8
Changes since 1.47: +6 -7 lines
Diff to previous 1.47 (colored)

Sprinkle volatile for gcc 5!

Revision 1.45.2.1 / (download) - annotate - [select for diffs], Tue Aug 19 23:45:11 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-maxphys
Changes since 1.45: +8 -4 lines
Diff to previous 1.45 (colored) next main 1.46 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.46.2.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:41:18 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.46: +4 -2 lines
Diff to previous 1.46 (colored) next main 1.47 (colored)

Rebase.

Revision 1.47 / (download) - annotate - [select for diffs], Wed Jun 18 18:17:30 2014 UTC (8 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7
Changes since 1.46: +4 -2 lines
Diff to previous 1.46 (colored)

Adjust to the new alias text libedit API.

Revision 1.44.2.2 / (download) - annotate - [select for diffs], Thu May 22 11:26:23 2014 UTC (8 years, 8 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.44.2.1: +6 -4 lines
Diff to previous 1.44.2.1 (colored) to branchpoint 1.44 (colored) next main 1.45 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.46 / (download) - annotate - [select for diffs], Sun Mar 23 05:07:59 2014 UTC (8 years, 10 months ago) by dholland
Branch: MAIN
CVS Tags: yamt-pagecache-base9, riastradh-xf86-video-intel-2-7-1-pre-2-21-15
Branch point for: tls-earlyentropy
Changes since 1.45: +6 -4 lines
Diff to previous 1.45 (colored)

don't use sprintf

Revision 1.44.2.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:01:38 2012 UTC (10 years, 9 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.44: +3 -5 lines
Diff to previous 1.44 (colored)

sync with head

Revision 1.45 / (download) - annotate - [select for diffs], Tue Mar 20 18:42:29 2012 UTC (10 years, 10 months ago) by matt
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900, agc-symver-base, agc-symver
Branch point for: tls-maxphys
Changes since 1.44: +3 -5 lines
Diff to previous 1.44 (colored)

Use C89 function definitions

Revision 1.44 / (download) - annotate - [select for diffs], Tue Jul 12 16:40:41 2011 UTC (11 years, 6 months ago) by joerg
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus
Branch point for: yamt-pagecache
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored)

Move the savehandler assignment before setjmp() to avoid triggering
warnings about use before initialization with clang.

Revision 1.42.4.1 / (download) - annotate - [select for diffs], Thu Jun 23 14:17:48 2011 UTC (11 years, 7 months ago) by cherry
Branch: cherry-xenmp
Changes since 1.42: +3 -2 lines
Diff to previous 1.42 (colored) next main 1.43 (colored)

Catchup with rmind-uvmplock merge.

Revision 1.43 / (download) - annotate - [select for diffs], Sat Jun 18 21:18:46 2011 UTC (11 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.42: +3 -2 lines
Diff to previous 1.42 (colored)

PR/45069: Henning Petersen: Use prototypes from builtins.h .

Revision 1.42 / (download) - annotate - [select for diffs], Fri Jan 7 22:21:56 2011 UTC (12 years ago) by jmmv
Branch: MAIN
CVS Tags: cherry-xenmp-base, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: cherry-xenmp
Changes since 1.41: +3 -3 lines
Diff to previous 1.41 (colored)

Call el_source before initializing sh-specific editline properties (i.e.
the editor type and the tab completion binding).

This allows tab completion to work when a user has an ~/.editrc file.

Addresses PR bin/43404.

Revision 1.40.8.1 / (download) - annotate - [select for diffs], Sun Mar 23 00:11:41 2008 UTC (14 years, 10 months ago) by matt
Branch: matt-armv6
Changes since 1.40: +3 -2 lines
Diff to previous 1.40 (colored) next main 1.41 (colored)

sync with HEAD

Revision 1.41 / (download) - annotate - [select for diffs], Wed Feb 13 12:57:16 2008 UTC (14 years, 11 months ago) by joerg
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, mjf-devfs2-base, mjf-devfs2, matt-premerge-20091211, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-premerge-20101231, matt-mips64-base2, matt-armv6-nbase, keiichi-mipv6-base, keiichi-mipv6, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, hpcarm-cleanup-nbase, hpcarm-cleanup-base
Changes since 1.40: +3 -2 lines
Diff to previous 1.40 (colored)

Set unique mode for the history, so that repeating a command doesn't
spam the history.

Revision 1.34.6.1 / (download) - annotate - [select for diffs], Sat Mar 31 14:04:58 2007 UTC (15 years, 10 months ago) by bouyer
Branch: netbsd-3
Changes since 1.34: +11 -2 lines
Diff to previous 1.34 (colored) next main 1.35 (colored)

Pull up following revision(s) (requested by mjf in ticket #1689):
	bin/sh/histedit.c: revision 1.38
Make the -s flag of fc work correctly. Ensure that only one command
is specified and ensure that we break out of the loop after executing it.
With the previous code, because the re-executed command was added to the
history, it would think that it still had to execute it, leading to
an infinite loop.

Revision 1.40 / (download) - annotate - [select for diffs], Mon Oct 16 00:36:19 2006 UTC (16 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf
Branch point for: matt-armv6
Changes since 1.39: +5 -17 lines
Diff to previous 1.39 (colored)

sprinkle volatile.

Revision 1.39 / (download) - annotate - [select for diffs], Wed May 10 21:53:14 2006 UTC (16 years, 8 months ago) by mrg
Branch: MAIN
CVS Tags: abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.38: +4 -2 lines
Diff to previous 1.38 (colored)

quell GCC 4.1 uninitialised variable warnings.

XXX: we should audit the tree for which old ones are no longer needed
after getting the older compilers out of the tree..

Revision 1.38 / (download) - annotate - [select for diffs], Mon Mar 6 00:09:22 2006 UTC (16 years, 11 months ago) by aymeric
Branch: MAIN
Changes since 1.37: +11 -2 lines
Diff to previous 1.37 (colored)

Make the -s flag of fc work correctly. Ensure that only one command is specified
and ensure that we break out of the loop after executing it.
With the previous code, because the re-executed command was added to the
history, it would think that it still had to execute it, leading to an infinite
loop.

The last thing which differs from ksh is that we get the "fc -s " command into
the history, but this is actually rather a feature in my humble opinion.

To test:
$ echo hello
$ fc -s ec
<infinite loop or correct behaviour>

Revision 1.37 / (download) - annotate - [select for diffs], Fri Jul 15 17:49:43 2005 UTC (17 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.36: +3 -3 lines
Diff to previous 1.36 (colored)

Only do certain actions when we are trully interactive, not just when we
are connected to a tty:
	1. enable editor
	2. print directory on directory change.
	3. print job messages

Revision 1.36 / (download) - annotate - [select for diffs], Mon May 9 11:35:19 2005 UTC (17 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.35: +7 -8 lines
Diff to previous 1.35 (colored)

Only add the function when we initialize. Restore the binding of tab to
ed-insert if tabcomplete is cleared.

Revision 1.35 / (download) - annotate - [select for diffs], Sat May 7 19:52:17 2005 UTC (17 years, 9 months ago) by dsl
Branch: MAIN
Changes since 1.34: +9 -2 lines
Diff to previous 1.34 (colored)

If 'set -o tabcomplete' it set, then bind <tab> to the libedit filename
completion function.
Note that the libedit code will probably want fine-tuning!
While editing the man page, add a note that non-whitespace IFS chars are
terminators and can generate null arguments.

Revision 1.34 / (download) - annotate - [select for diffs], Mon Oct 27 06:19:29 2003 UTC (19 years, 3 months ago) by lukem
Branch: MAIN
CVS Tags: netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2
Branch point for: netbsd-3
Changes since 1.33: +7 -4 lines
Diff to previous 1.33 (colored)

skip a leading `-' on the arg0 name when calling el_init()

Revision 1.33 / (download) - annotate - [select for diffs], Sun Oct 19 19:13:21 2003 UTC (19 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.32: +3 -2 lines
Diff to previous 1.32 (colored)

Let libedit handle signals so we resize properly. I might change my mind
later on that.

Revision 1.32 / (download) - annotate - [select for diffs], Sun Oct 19 01:55:05 2003 UTC (19 years, 3 months ago) by lukem
Branch: MAIN
Changes since 1.31: +9 -2 lines
Diff to previous 1.31 (colored)

Ensure that $TERM is set in the real environment before calling el_init(3)
when executing "set -o (emacs|vi)".   Fixes [bin/23175] from me.

Revision 1.31 / (download) - annotate - [select for diffs], Thu Aug 7 09:05:32 2003 UTC (19 years, 6 months ago) by agc
Branch: MAIN
Changes since 1.30: +3 -7 lines
Diff to previous 1.30 (colored)

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.

Revision 1.30 / (download) - annotate - [select for diffs], Sun Jul 13 08:31:13 2003 UTC (19 years, 6 months ago) by itojun
Branch: MAIN
Changes since 1.29: +3 -3 lines
Diff to previous 1.29 (colored)

use bounded string op

Revision 1.29 / (download) - annotate - [select for diffs], Sun May 4 06:36:50 2003 UTC (19 years, 9 months ago) by gmcgarry
Branch: MAIN
Changes since 1.28: +2 -4 lines
Diff to previous 1.28 (colored)

ANSIify.

Revision 1.28 / (download) - annotate - [select for diffs], Sun May 4 01:05:24 2003 UTC (19 years, 9 months ago) by gmcgarry
Branch: MAIN
Changes since 1.27: +31 -2 lines
Diff to previous 1.27 (colored)

Add new builtin 'inputrc' which allows keybindings to be redefined
for the current shell.  From Arne H Juul in PR#10097.

Revision 1.27 / (download) - annotate - [select for diffs], Sun Nov 24 22:35:40 2002 UTC (20 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.26: +22 -23 lines
Diff to previous 1.26 (colored)

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...)

Revision 1.26 / (download) - annotate - [select for diffs], Tue Mar 12 00:14:31 2002 UTC (20 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6, ELRICshvfork-base, ELRICshvfork
Changes since 1.25: +2 -4 lines
Diff to previous 1.25 (colored)

get rid of sp completely, we were free-ing a bogus pointer; found by simonb.

Revision 1.25 / (download) - annotate - [select for diffs], Sun Feb 4 19:52:06 2001 UTC (22 years ago) by christos
Branch: MAIN
Changes since 1.24: +3 -3 lines
Diff to previous 1.24 (colored)

remove redundant declarations and nexted externs.

Revision 1.24 / (download) - annotate - [select for diffs], Mon Nov 6 04:21:14 2000 UTC (22 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.23: +3 -2 lines
Diff to previous 1.23 (colored)

Call el_source() to use .editrc.

Revision 1.23 / (download) - annotate - [select for diffs], Fri Apr 14 05:52:58 2000 UTC (22 years, 9 months ago) by simonb
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5, minoura-xpg4dl-base, minoura-xpg4dl
Changes since 1.22: +2 -4 lines
Diff to previous 1.22 (colored)

Don't declare 'extern opt*' getopt variables.

Revision 1.22 / (download) - annotate - [select for diffs], Thu Jan 27 23:39:40 2000 UTC (23 years ago) by christos
Branch: MAIN
Changes since 1.21: +4 -4 lines
Diff to previous 1.21 (colored)

Fix bin/9184, bin/9194, bin/9265, bin/9266
Exitcode and negation problems (From Martin Husemann)

Revision 1.21 / (download) - annotate - [select for diffs], Fri Jul 9 03:05:50 1999 UTC (23 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.20: +14 -11 lines
Diff to previous 1.20 (colored)

compile with WARNS = 2

Revision 1.20 / (download) - annotate - [select for diffs], Tue Jul 28 11:41:55 1998 UTC (24 years, 6 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4
Changes since 1.19: +6 -3 lines
Diff to previous 1.19 (colored)

Be more retentive about use of NOTREACHED and noreturn.

Revision 1.19 / (download) - annotate - [select for diffs], Wed May 20 00:29:26 1998 UTC (24 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.18: +4 -4 lines
Diff to previous 1.18 (colored)

fix bug where if moving in history during a multi-line event, the
append to history event would end up in the last event where the history
was moved to instead of the multi-line event; reported by Mycroft

Revision 1.16.2.2 / (download) - annotate - [select for diffs], Fri May 8 06:01:03 1998 UTC (24 years, 9 months ago) by mycroft
Branch: netbsd-1-3
CVS Tags: netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002
Changes since 1.16.2.1: +3 -3 lines
Diff to previous 1.16.2.1 (colored) to branchpoint 1.16 (colored) next main 1.17 (colored)

Sync with trunk, per request of christos.

Revision 1.18 / (download) - annotate - [select for diffs], Tue Apr 7 10:16:04 1998 UTC (24 years, 10 months ago) by fair
Branch: MAIN
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

Change a few things to reference /usr/include/paths.h instead of local
references. Fixing the default PATH is a bit more effort.

Revision 1.16.2.1 / (download) - annotate - [select for diffs], Thu Nov 13 00:07:29 1997 UTC (25 years, 2 months ago) by mellon
Branch: netbsd-1-3
CVS Tags: netbsd-1-3-RELEASE, netbsd-1-3-PATCH001, netbsd-1-3-BETA
Changes since 1.16: +4 -3 lines
Diff to previous 1.16 (colored)

Pull rev 1.17 up from trunk (cjs)

Revision 1.17 / (download) - annotate - [select for diffs], Wed Nov 12 03:40:55 1997 UTC (25 years, 2 months ago) by cjs
Branch: MAIN
Changes since 1.16: +4 -3 lines
Diff to previous 1.16 (colored)

Make this compile with -DSMALL and warnings on.

Revision 1.16 / (download) - annotate - [select for diffs], Tue Oct 14 15:06:42 1997 UTC (25 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-3-base
Branch point for: netbsd-1-3
Changes since 1.15: +30 -28 lines
Diff to previous 1.15 (colored)

PR/4257: Jaromir Dolecek: Update for libedit interface change.

Revision 1.15 / (download) - annotate - [select for diffs], Sun Sep 14 07:43:56 1997 UTC (25 years, 4 months ago) by lukem
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

getopt returns -1 not EOF

Revision 1.14 / (download) - annotate - [select for diffs], Fri Jul 4 21:02:02 1997 UTC (25 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.13: +3 -2 lines
Diff to previous 1.13 (colored)

Fix compiler warnings.

Revision 1.13 / (download) - annotate - [select for diffs], Fri Apr 11 22:45:41 1997 UTC (25 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.12: +13 -2 lines
Diff to previous 1.12 (colored)

Track $TERM and call the appropriate editline(3) routine to update the
terminal type.

Revision 1.12 / (download) - annotate - [select for diffs], Fri Mar 14 01:42:20 1997 UTC (25 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

NO_HISTORY->SMALL

Revision 1.11 / (download) - annotate - [select for diffs], Thu Mar 13 21:57:32 1997 UTC (25 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.10: +11 -3 lines
Diff to previous 1.10 (colored)

Fix problems with -DNO_HISTORY

Revision 1.8.6.1 / (download) - annotate - [select for diffs], Sun Jan 26 04:57:20 1997 UTC (26 years ago) by rat
Branch: netbsd-1-2
CVS Tags: netbsd-1-2-PATCH001
Changes since 1.8: +16 -17 lines
Diff to previous 1.8 (colored) next main 1.9 (colored)

Update /bin/sh from trunk per request of Christos Zoulas.  Fixes
many bugs.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Oct 16 14:40:32 1996 UTC (26 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.9: +12 -12 lines
Diff to previous 1.9 (colored)

PR/2808: Remove extraneous newlines from error routines (from FreeBSD)

Revision 1.9 / (download) - annotate - [select for diffs], Tue Jun 25 16:43:34 1996 UTC (26 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.8: +7 -8 lines
Diff to previous 1.8 (colored)

change sethistsize() to take the history size as an argument so it can
be used directly by the new variable callback functions.

Revision 1.8 / (download) - annotate - [select for diffs], Thu May 11 21:29:12 1995 UTC (27 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-BETA, netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Branch point for: netbsd-1-2
Changes since 1.7: +29 -12 lines
Diff to previous 1.7 (colored)

Merge in my changes from vangogh, and fix the x=`false`; echo $? == 0
bug.

Revision 1.7 / (download) - annotate - [select for diffs], Fri Mar 31 21:58:13 1995 UTC (27 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.6: +4 -2 lines
Diff to previous 1.6 (colored)

1. Don't core dump on 'fc -l' (From Gerard J van der Grinten)
2. PATH=xxx ls, does the PATH assignment first and then tries to find ls in xxx
3. VAR=xxx exec ls, does the variable assignment.

Revision 1.6 / (download) - annotate - [select for diffs], Tue Mar 21 09:09:09 1995 UTC (27 years, 10 months ago) by cgd
Branch: MAIN
Changes since 1.5: +7 -2 lines
Diff to previous 1.5 (colored)

convert to new RCS id conventions.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Dec 5 19:07:42 1994 UTC (28 years, 2 months ago) by cgd
Branch: MAIN
Changes since 1.4: +3 -1 lines
Diff to previous 1.4 (colored)

clean up further.  more patches from Jim Jegers

Revision 1.4 / (download) - annotate - [select for diffs], Sun Dec 4 07:12:13 1994 UTC (28 years, 2 months ago) by cgd
Branch: MAIN
Changes since 1.3: +14 -3 lines
Diff to previous 1.3 (colored)

from James Jegers <jimj@miller.cs.uwm.edu>: quiet -Wall, and squelch
some of the worst style errors.

Revision 1.3 / (download) - annotate - [select for diffs], Sat Jun 11 16:11:57 1994 UTC (28 years, 7 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-0-base, netbsd-1-0-RELEASE, netbsd-1-0-PATCH1, netbsd-1-0-PATCH06, netbsd-1-0-PATCH05, netbsd-1-0-PATCH04, netbsd-1-0-PATCH03, netbsd-1-0-PATCH02, netbsd-1-0-PATCH0, netbsd-1-0
Changes since 1.2: +2 -1 lines
Diff to previous 1.2 (colored)

Add RCS ids.

Revision 1.2 / (download) - annotate - [select for diffs], Thu May 12 17:03:40 1994 UTC (28 years, 8 months ago) by jtc
Branch: MAIN
Changes since 1.1: +2 -0 lines
Diff to previous 1.1 (colored)

Include appropriate header files to bring function prototypes into scope.

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed May 11 17:01:57 1994 UTC (28 years, 8 months ago) by jtc
Branch: CSRG
CVS Tags: lite-1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

44lite code

Revision 1.1 / (download) - annotate - [select for diffs], Wed May 11 17:01:56 1994 UTC (28 years, 8 months ago) by jtc
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>