CVS commit: src/bin/ed
Module Name:src Committed By: rillig Date: Wed Apr 10 17:52:41 UTC 2024 Modified Files: src/bin/ed: glbl.c Log Message: ed: fix inconsistency in comment To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/bin/ed/glbl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/bin/ed
Module Name:src Committed By: rillig Date: Wed Apr 10 17:52:41 UTC 2024 Modified Files: src/bin/ed: glbl.c Log Message: ed: fix inconsistency in comment To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/bin/ed/glbl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ed/glbl.c diff -u src/bin/ed/glbl.c:1.10 src/bin/ed/glbl.c:1.11 --- src/bin/ed/glbl.c:1.10 Fri Jan 4 19:13:58 2019 +++ src/bin/ed/glbl.c Wed Apr 10 17:52:41 2024 @@ -1,6 +1,6 @@ -/* $NetBSD: glbl.c,v 1.10 2019/01/04 19:13:58 maya Exp $ */ +/* $NetBSD: glbl.c,v 1.11 2024/04/10 17:52:41 rillig Exp $ */ -/* glob.c: This file contains the global command routines for the ed line +/* glbl.c: This file contains the global command routines for the ed line editor */ /*- * Copyright (c) 1993 Andrew Moore, Talke Studio. @@ -33,7 +33,7 @@ #if 0 static char *rcsid = "@(#)glob.c,v 1.1 1994/02/01 00:34:40 alm Exp"; #else -__RCSID("$NetBSD: glbl.c,v 1.10 2019/01/04 19:13:58 maya Exp $"); +__RCSID("$NetBSD: glbl.c,v 1.11 2024/04/10 17:52:41 rillig Exp $"); #endif #endif /* not lint */
CVS commit: src/bin/ed
Module Name:src Committed By: andvar Date: Fri May 20 07:47:17 UTC 2022 Modified Files: src/bin/ed: POSIX Log Message: fix some misspellings and remove trailing whitespaces. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/bin/ed/POSIX Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/bin/ed
Module Name:src Committed By: andvar Date: Fri May 20 07:47:17 UTC 2022 Modified Files: src/bin/ed: POSIX Log Message: fix some misspellings and remove trailing whitespaces. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/bin/ed/POSIX Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ed/POSIX diff -u src/bin/ed/POSIX:1.10 src/bin/ed/POSIX:1.11 --- src/bin/ed/POSIX:1.10 Thu Nov 18 19:16:34 1999 +++ src/bin/ed/POSIX Fri May 20 07:47:16 2022 @@ -1,4 +1,4 @@ -$NetBSD: POSIX,v 1.10 1999/11/18 19:16:34 kristerw Exp $ +$NetBSD: POSIX,v 1.11 2022/05/20 07:47:16 andvar Exp $ This version of ed(1) is not strictly POSIX compliant, as described in the POSIX 1003.2 document. The following is a summary of the omissions, @@ -14,8 +14,8 @@ OMISSIONS 3) To support the BSD `s' command (see extension [1] below), substitution patterns cannot be delimited by numbers or the characters - `r', `g' and `p'. In contrast, POSIX specifies any character expect - space or newline can used as a delimiter. + `r', `g' and `p'. In contrast, POSIX specifies any character except + space or newline can be used as a delimiter. EXTENSIONS -- @@ -25,11 +25,11 @@ EXTENSIONS ii) `W' for appending text to an existing file, iii) `wq' for exiting after a write, iv) `z' for scrolling through the buffer, and - v) BSD line addressing syntax (i.e., `^' and `%') is recognized. + v) BSD line addressing syntax (i.e., `^' and `%') is recognized. 2) If crypt(3) is available, files can be read and written using DES encryption. The `x' command prompts the user to enter a key used for - encrypting/ decrypting subsequent reads and writes. If only a newline + encrypting/decrypting subsequent reads and writes. If only a newline is entered as the key, then encryption is disabled. Otherwise, a key is read in the same manner as a password entry. The key remains in effect until encryption is disabled. For more information on the @@ -77,11 +77,11 @@ DEVIATIONS 2) Since the behavior of `u' (undo) within a `g' (global) command list is not specified by POSIX, it follows the behavior of the SunOS ed: undo forces a global command list to be executed only once, rather than - for each line matching a global pattern. In addtion, each instance of + for each line matching a global pattern. In addition, each instance of `u' within a global command undoes all previous commands (including undo's) in the command list. This seems the best way, since the alternatives are either too complicated to implement or too confusing - to use. + to use. The global/undo combination is useful for masking errors that would otherwise cause a script to fail. For instance, an ed script
CVS commit: src/bin/ed
Module Name:src Committed By: nia Date: Tue Nov 2 08:04:20 UTC 2021 Modified Files: src/bin/ed: undo.c Log Message: ed(1): use reallocarr instead of realloc(x * y) To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/bin/ed/undo.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ed/undo.c diff -u src/bin/ed/undo.c:1.7 src/bin/ed/undo.c:1.8 --- src/bin/ed/undo.c:1.7 Fri Jan 4 19:13:58 2019 +++ src/bin/ed/undo.c Tue Nov 2 08:04:20 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: undo.c,v 1.7 2019/01/04 19:13:58 maya Exp $ */ +/* $NetBSD: undo.c,v 1.8 2021/11/02 08:04:20 nia Exp $ */ /* undo.c: This file contains the undo routines for the ed line editor */ /*- @@ -32,7 +32,7 @@ #if 0 static char *rcsid = "@(#)undo.c,v 1.1 1994/02/01 00:34:44 alm Exp"; #else -__RCSID("$NetBSD: undo.c,v 1.7 2019/01/04 19:13:58 maya Exp $"); +__RCSID("$NetBSD: undo.c,v 1.8 2021/11/02 08:04:20 nia Exp $"); #endif #endif /* not lint */ @@ -48,19 +48,17 @@ long u_p = 0; /* undo stack pointer undo_t * push_undo_stack(int type, long from, long to) { - undo_t *t; + int err; - t = ustack; if (u_p < usize || - (t = (undo_t *) realloc(ustack, (usize += USIZE) * sizeof(undo_t))) != NULL) { - ustack = t; + (err = reallocarr(, usize += USIZE, sizeof(undo_t))) == 0) { ustack[u_p].type = type; ustack[u_p].t = get_addressed_line_node(to); ustack[u_p].h = get_addressed_line_node(from); return ustack + u_p++; } /* out of memory - release undo stack */ - fprintf(stderr, "%s\n", strerror(errno)); + fprintf(stderr, "%s\n", strerror(err)); seterrmsg("out of memory"); clear_undo_stack(); free(ustack);
CVS commit: src/bin/ed
Module Name:src Committed By: nia Date: Tue Nov 2 08:04:20 UTC 2021 Modified Files: src/bin/ed: undo.c Log Message: ed(1): use reallocarr instead of realloc(x * y) To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/bin/ed/undo.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/bin/ed
On Tue, Mar 25, 2014 at 05:23:37PM +, Joerg Sonnenberger wrote: Modified Files: src/bin/ed: ed.h Log Message: Use __printflike. Oops, sorry about that. -- David A. Holland dholl...@netbsd.org