summaryrefslogtreecommitdiffstats
path: root/bin/ed/main.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r292454, r292455pfg2015-12-261-4/+6
| | | | | | | | | ed(1): Prevent possible string overflows Use strlcpy to guarantee NULL termination. With hint from: imp, cem, ngie CID: 1007252
* Fix warnings found by -Wmising-variable-declarations.ed2012-10-191-15/+16
| | | | | | | | | | | This self-written compiler warning, which is hopefully going to be committed into LLVM sources soon, warns about potentially missing `static' keywords, similar to -Wmissing-prototypes. - bin/pax: Move external declaration of chdname and s_mask into extern.h. - bin/setfacl: Move setfacl.c-specific stuff out of setfacl.h. - sbin/mount_fusefs: Remove char *progname; use getprogname(). - others: add `static' where possible.
* Fix some obtuse fprintf tricks in bin/ed.dim2011-12-161-16/+16
| | | | MFC after: 1 week
* ed(1): make WARNS=6 cleanuqs2010-03-041-6/+1
| | | | | | | | Although argc and argv are never read after the longjmp is complete, gcc is not clever enough to see that and needlessly warns about it. So add volatile to silence the compiler. Approved by: ed (the co-mentor, not ed(1))
* while(0); -> while (0) in multiline macroimp2006-08-171-1/+1
|
* Sync program's usage() with manpage's SYNOPSIS.ru2005-02-091-2/+2
|
* no need to have break; after return;charnier2005-01-161-1/+1
|
* Quiet warnings about copyright[].obrien2003-05-011-0/+2
|
* Replace various spellings with FALLTHROUGH which is lint()ablecharnier2002-08-251-2/+2
|
* Consistently use __FBSDIDobrien2002-06-301-4/+2
|
* We have a place for extern declarations of global variables in ed.h, do notjmallett2002-06-201-3/+0
| | | | use main() to do it locally.
* o __P has been reovedimp2002-02-021-54/+26
| | | | | | | | | | | | o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are. o gc some #ifdef sun ... #endif code Approved by: arch@, new style(9)
* o Correctly define rcsid.mike2001-08-061-63/+64
| | | | | | | | | | | o Add consts where appropriate. o Rename some variables that were shadowing global declarations. o Remove register storage-classes. o Make errmsg a const, so we can just set error messages instead of using sprintf/strcpy. o Set WARNS=2 Reviewed by: bde, des
* Back out previous commit: it doesn't help anything since write_file(),dd2001-06-281-2/+2
| | | | | | | | which is also called from handle_hup(), uses stdio(3). Furthermore, this means that calling exit(3) (via quit()) there is required to flush the buffer write_file() was working on. Submitted by: bde
* Don't call exit(3) from a signal handler.dd2001-06-241-2/+2
| | | | Obtained from: OpenBSD
* Use PATH_MAX rather than MAXPATHLEN. Also fix a possible off by oneimp2001-05-291-7/+8
| | | | | | | error caused by the -1 being on the wrong side of the comparison. This would not cause an overflow, as near as I can tell, because we truncate later anyway. We'd just fail to get a diagnostic for 1024 and 1025 byte file names.
* Constifykris2000-11-271-1/+1
|
* Include sys/types.hbrian2000-10-161-0/+2
|
* Fixes a potential buffer overflow with 'ed [MAXPATHLEN + 1 characters]'.joe2000-04-301-3/+5
| | | | | Submitted by: Mike Heffner <spock@techfour.net> Submitted on: audit@freebsd.org
* $Id$ -> $FreeBSD$peter1999-08-271-1/+1
|
* Silence some warnings when building on the alpha.dfr1998-08-071-2/+2
|
* make signal handlers errno safeeivind1997-10-081-3/+8
| | | | Obtained from: OpenBSD (file rev 1.11) - Theo de Raadt <deraadt@openbsd.org>
* sccsid -> rcsid and fix some minor nits.steve1997-08-071-8/+7
|
* compare return value from getopt against -1 rather than EOF, per the finalimp1997-03-281-2/+2
| | | | posix standard on the topic.
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* -Wall cleaning.steve1996-12-141-3/+8
|
* Localize itache1996-08-111-10/+13
| | | | 8bit cleanup
* Remove trailing whitespace.rgrimes1995-05-301-15/+15
| | | | Reviewed by: phk
* You will find enclosed some changes to make gcc -Wall more happy injoerg1995-03-191-9/+9
| | | | | | | | | /usr/src/bin. Note that some patches are still needed in that directory. I (Joerg) finished most of Philippe's cleanup. /bin/sh will still need *allot* of work, however. Submitted by: charnier@lirmm.fr (Philippe Charnier)
* Added $Id$dg1994-09-241-0/+2
|
* use umask 077 for buffer filealm1994-03-231-1/+1
|
* Fixed range address bug: 1,2, == 2,2 not 2,.alm1994-02-011-0/+1432
Overhauled the name space, reworked some modules and removed the obsolescent Addison-Wesley copyright.
OpenPOWER on IntegriCloud