summaryrefslogtreecommitdiffstats
path: root/bin/ed (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add some references, most of these were removed when we stopped buildingjsg2021-03-081-2/+12
| | | | | | and installing USD/SMM/PSD docs. jmc@ agrees with the direction, ok millert@ on an earlier diff
* Rev 1.17 of sub.c removed infinite loop detection from s command.bluhm2020-01-094-4/+3
| | | | | Adapt substitute test to new ed(1) behavior. Note that substitute result from sed(1) is still different.
* Rev 1.59 of main.c allows omission of addresses in a range.bluhm2020-01-0919-1/+53
| | | | Adapt ed test.
* Rev 1.42 of main.c allows zero address for i command.bluhm2020-01-093-0/+3
| | | | Adapt ed test.
* In addresses, consistently use "+" rather than ".+1".schwarze2019-07-301-6/+6
| | | | | | | Both have the same meaning, but the former is explicitly defined in this manual page as "the next line" whereas the latter requires combining various pieces of information for understanding. Unification suggested and patch OK'ed by martijn@.
* 1. Correct the description of the g command to match POSIX and ourschwarze2019-07-201-21/+27
| | | | | | | | | | | implementation; it was oversimplified and arguably incorrect. 2. Explicitely compare the behaviour of empty command lists for g, empty command lists for G, and empty commands because these subtle differences are quite confusing. 3. Say more precisely what the v and V commands do, avoiding the fuzzy wording "similar". All these issues were first pointed out by martijn@. Feedback and OK martijn@; "diff reads ok" jmc@ on an earlier version.
* Explain in which circumstances trailing slashes can be omitted afterschwarze2019-07-151-6/+11
| | | | | | | the g and G commands, and polish the wording a bit explaining empty command lists. Closing a gap in the manual reported by <mazocomp at disroot dot org>. OK jmc@ martijn@
* Minor polishing:schwarze2019-07-121-5/+9
| | | | | | | | | * Delete a stray blank from the command line synopsis and add the missing .Ar markup to it. * Do not mention the terminating newline for the empty command since it isn't mentioned for any other command either. * Make the description of the empty command easier to understand. Joint work with martijn@ and jmc@.
* document the dropping of the second / and ? in line address REs;jmc2019-07-101-2/+4
| | | | | | thread started by mazocomp; diff from ropers, shortened by me; ok martijn schwarze
* fputc returns EOFderaadt2019-06-281-2/+2
|
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-282-11/+10
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* Be precise in checking for errors. pclose(3) returns -1 and fclose(3)florian2019-06-271-3/+3
| | | | | | | EOF in case of errors, not any negative number. EOF corner case spotted while reviewing a much bigger diff by deraadt OK deraadt, millert
* Revert previous, there were some unintended beviour changes.martijn2018-06-191-3/+27
|
* Remove the parse_char_class and let regcomp determine if our bracketsmartijn2018-06-181-27/+3
| | | | | | are balanced. OK millert@ and tb@
* Remove references to BACKWARDS.martijn2018-06-152-6/+2
| | | | OK tb@
* Make sure we always return more than a single '!' in get_shell_command.martijn2018-06-151-5/+5
| | | | | | This is similar to what vi/ex does and removes the final BACKWARDS flag. Behaviour requested by and OK tb@
* Remove the non-BACKWARDS option for GET_THIRD_ADDR. No change to currentmartijn2018-06-151-22/+1
| | | | | | behaviour. OK tb@
* Remove the extra pager code when compiled without the BACKWARDS flag.martijn2018-06-041-13/+1
| | | | | | | Most terminals have scrollback options, or can be achieved via tmux, so it's not needed. OK millert@
* Definitively choose the existing semantics for the scroll and null command.martijn2018-06-042-15/+2
| | | | | | | | POSIX states: "An empty command list shall be equivalent to the p command", so changing the behaviour of a null-command in any other case is a violation of POSIX. OK millert@
* Fail earlier if we don't have a current filename. This simlifies themartijn2018-05-241-52/+26
| | | | | | code and removes a few BACKWARDS flags. OK otto@
* Make ed's 'l' command end lines with a '$' and make sure that literalmartijn2018-04-262-21/+6
| | | | | | | | | | | | | | | | | | | | | '$' characters are escaped, so that we are POSIX compliant. The omission of trailing '$' was originally hidden behind a BACKWARDS flag. This flag was most likely introduced to be compatible with 4.4BSD. Thanks to naddy@ for pointing me to the 4.4BSD ed implementation. I tried to trace the origin and enabling of the BACKWARDS flag, since both FreeBSD and NetBSD have the flag, but only FreeBSD doesn't have it enabled. Both projects had an alm@ working on ed during 1993-1995 during which he added this flag to both projects and only enabled it on NetBSD, but I wasn't able to reach him on any known address. Thanks to Ed Schouten (ed@freebsd), and Michael W. Lucas of the ed Mastery book for helping me trying to locate Andrew Moore. Problem originally prodded by garzon.lucero@gmail.com and later independently re-requested by n.reusse@hxgn.net. OK tb@, guenther@, and mwl@mwl.io
* Make ed(1) warn about modifications if 'r'ead in an empty file andmartijn2018-02-261-2/+2
| | | | | | | trying to quit. Diff from Tim Chase OK tb@ and millert@
* Rename test file =.err to eq.err for simpler make file scripts.bluhm2018-01-092-2/+2
|
* nits about trailing punctuation found with mandoc -Tlintschwarze2017-07-051-3/+3
|
* silence clang warnings: add an extra pair of parentheses and stopnaddy2017-04-263-22/+27
| | | | passing empty format strings to printf-family functions; ok millert@
* Allow the omission of one address in (.,.) and (.;.) address rangestb2017-01-031-2/+3
| | | | | | | | as per POSIX. With this patch, ",n" is an abbreviation for "1,n", ";n" abbreviates ".;n". The "n," and "n;" variants mean "n,n" and "n;n", respectively. Patch from Jerome FRGAGIC; ok stefan, deraadt
* Reimplement g flag for s commands. Got lost in previous commit.martijn2016-10-111-2/+2
| | | | Found because of a hint by and OK schwarze@.
* Remove infinite loop detection from the s-command.martijn2016-10-101-9/+11
| | | | | | | | If a zero-length match is found do the replacement and increment the start point for the next search by one. This allows for commands like s/^/- / This brings the behaviour closer to the way sed and vi work. OK schwarze@
* remove the note about the list command (l) displaying a --More--jmc2016-09-231-8/+2
| | | | | | | prompt for huge lines (according to otto this happens only when BACKWARDS is not defined); ok otto
* Piping to a shell command does not count as a save, so don't reset thenatano2016-08-161-2/+2
| | | | | | modified flag. from Jerome Frgacic (jerome.frgacic (at) yahoo.fr) ok tb
* Fix the begin of word bug in s-command, similar to sed.martijn2016-08-021-22/+25
| | | | nit fix and OK schwarze@
* actually remove unnecessary includesmmcc2016-03-271-7/+1
| | | | from Edgar Pettijohn, ok and with input from tb@
* header cleanupmmcc2016-03-227-10/+56
| | | | from Edgar Pettijohn, correction from deraadt@
* honestly i think you should just zap that paragraph - it doesn;t maketb2015-11-201-12/+1
| | | | | | | sense to document that posix more or less says something should happen, and that it does. jmc
* make ed restore the user defined prompt (specified with -p) when it was turnedtb2015-11-202-6/+5
| | | | | | off and then on again with 'P'. ok daniel@
* POSIX says that you can't capture the return value of sigsetjmp().guenther2015-10-251-2/+3
| | | | | | Fortunately, we don't need it as we only pass siglongjmp() a single value. ok deraadt@
* Style fixes; from Ilya Kalimanmillert2015-10-211-2/+2
|
* The variable errmsg can be static in main.c if code in re.c uses an owntobias2015-10-093-6/+7
| | | | | | buffer to construct error messages. with input by and ok millert@
* Define functions as static when they are not used outside their own c-files.tobias2015-10-096-55/+56
| | | | ok millert@
* Mark static globals that are only used in their respective .c files.millert2015-10-097-41/+41
| | | | | Also make stdin unbuffered since that is the same as using a single-byte buffer. OK tobias@
* Change all tame callers to namechange to pledge(2).deraadt2015-10-091-3/+3
|
* tame "stdio rpath wpath cpath proc exec tty". proc and exec because edderaadt2015-10-071-1/+5
| | | | | it is a shell (it has a !command). tty because it uses TIOCGWINSZ in a SIGWINCH handler.
* Remove useless pattern_t typedef, POSIX regex is here to stay somillert2015-10-045-20/+18
| | | | just use regex_t directly.
* Remove #ifdefs for non-POSIX systems. Also remove #ifdef formillert2015-10-042-23/+4
| | | | | SIGWINCH, it is not POSIX but it is a defacto standard. OK deraadt@
* Avoid .Ns right after .Pf, it's pointless.schwarze2015-09-141-5/+5
| | | | In some cases, do additional cleanup in the immediate vicinity.
* remove gratuitous castsderaadt2015-07-283-6/+6
|
* use atomic operations on sig_atomic_t variables inside the signal handlers,deraadt2015-07-142-18/+27
| | | | | rather than sharing one variable unsafely. ok millert
* XXX annotate another signal racederaadt2015-07-111-2/+2
|
* theo buehler points out that posix specifies a prompt defined using -pjmc2015-06-221-2/+14
| | | | | | | | | | | | be reinstated when toggled off then on again; this seems to make sense, but posix is not explicit. we know that gnu ed and freebsd do reinstate the user defined prompt, but we do not. no one has yet stepped up to change this, so i'm adding a note to this effect until such a time as we do/ i have not tweaked the text for -p or "P" to allow for an easy back out if behaviour does change;
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-163-14/+13
| | | | | | | | | possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)