Thu Mar 11 22:31:19 2021 UTC ()
remove extra increment; fixes: echo o | sed -e 's/o/\a/'


(christos)
diff -r1.48 -r1.49 src/usr.bin/sed/compile.c

cvs diff -r1.48 -r1.49 src/usr.bin/sed/compile.c (expand / switch to unified diff)

--- src/usr.bin/sed/compile.c 2019/10/05 20:23:55 1.48
+++ src/usr.bin/sed/compile.c 2021/03/11 22:31:19 1.49
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: compile.c,v 1.48 2019/10/05 20:23:55 christos Exp $ */ 1/* $NetBSD: compile.c,v 1.49 2021/03/11 22:31:19 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1992 Diomidis Spinellis. 4 * Copyright (c) 1992 Diomidis Spinellis.
5 * Copyright (c) 1992, 1993 5 * Copyright (c) 1992, 1993
6 * The Regents of the University of California. All rights reserved. 6 * The Regents of the University of California. All rights reserved.
7 * 7 *
8 * This code is derived from software contributed to Berkeley by 8 * This code is derived from software contributed to Berkeley by
9 * Diomidis Spinellis of Imperial College, University of London. 9 * Diomidis Spinellis of Imperial College, University of London.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -28,27 +28,27 @@ @@ -28,27 +28,27 @@
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE. 33 * SUCH DAMAGE.
34 */ 34 */
35 35
36#if HAVE_NBTOOL_CONFIG_H 36#if HAVE_NBTOOL_CONFIG_H
37#include "nbtool_config.h" 37#include "nbtool_config.h"
38#endif 38#endif
39 39
40#include <sys/cdefs.h> 40#include <sys/cdefs.h>
41__RCSID("$NetBSD: compile.c,v 1.48 2019/10/05 20:23:55 christos Exp $"); 41__RCSID("$NetBSD: compile.c,v 1.49 2021/03/11 22:31:19 christos Exp $");
42#ifdef __FBSDID 42#ifdef __FBSDID
43__FBSDID("$FreeBSD: head/usr.bin/sed/compile.c 259132 2013-12-09 18:57:20Z eadler $"); 43__FBSDID("$FreeBSD: head/usr.bin/sed/compile.c 259132 2013-12-09 18:57:20Z eadler $");
44#endif 44#endif
45 45
46#if 0 46#if 0
47static const char sccsid[] = "@(#)compile.c 8.1 (Berkeley) 6/6/93"; 47static const char sccsid[] = "@(#)compile.c 8.1 (Berkeley) 6/6/93";
48#endif 48#endif
49 49
50#include <sys/types.h> 50#include <sys/types.h>
51#include <sys/stat.h> 51#include <sys/stat.h>
52 52
53#include <ctype.h> 53#include <ctype.h>
54#include <err.h> 54#include <err.h>
@@ -521,27 +521,26 @@ unescape(char **pp, char **spp) @@ -521,27 +521,26 @@ unescape(char **pp, char **spp)
521 if (!ston(&p, sp, 8)) 521 if (!ston(&p, sp, 8))
522 return 0; 522 return 0;
523 break; 523 break;
524 case 'd': 524 case 'd':
525 if (!ston(&p, sp, 10)) 525 if (!ston(&p, sp, 10))
526 return 0; 526 return 0;
527 break; 527 break;
528 case 'x': 528 case 'x':
529 if (!ston(&p, sp, 16)) 529 if (!ston(&p, sp, 16))
530 return 0; 530 return 0;
531 break; 531 break;
532 case 'a': 532 case 'a':
533 *sp = '\a'; 533 *sp = '\a';
534 p++; 
535 break; 534 break;
536#if 0 535#if 0
537 // No, \b RE 536 // No, \b RE
538 case 'b': 537 case 'b':
539 *sp = '\b'; 538 *sp = '\b';
540 break; 539 break;
541#endif 540#endif
542 case 'f': 541 case 'f':
543 *sp = '\f'; 542 *sp = '\f';
544 break; 543 break;
545 case 'n': 544 case 'n':
546 *sp = '\n'; 545 *sp = '\n';
547 break; 546 break;