pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc Sync nbsed with -current and bump its version to 20040...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d9f219e4ffaa
branches:  trunk
changeset: 476509:d9f219e4ffaa
user:      minskim <minskim%pkgsrc.org@localhost>
date:      Sat Jun 12 05:18:23 2004 +0000

description:
Sync nbsed with -current and bump its version to 20040612.  This fixes
a bug reported in PR bin/25899 that makes sed(1) fail if the last
character of the line buffer is a backslash.

diffstat:

 doc/CHANGES                    |   3 ++-
 textproc/nbsed/Makefile        |   4 ++--
 textproc/nbsed/files/compile.c |  31 ++++++++++++++++++++++++++-----
 3 files changed, 30 insertions(+), 8 deletions(-)

diffs (85 lines):

diff -r 7dc68c1ac8e0 -r d9f219e4ffaa doc/CHANGES
--- a/doc/CHANGES       Sat Jun 12 04:45:21 2004 +0000
+++ b/doc/CHANGES       Sat Jun 12 05:18:23 2004 +0000
@@ -1,4 +1,4 @@
-$NetBSD: CHANGES,v 1.6202 2004/06/11 23:13:37 jdarrow Exp $
+$NetBSD: CHANGES,v 1.6203 2004/06/12 05:18:23 minskim Exp $
 
 Changes to the packages collection and infrastructure in 2004:
 
@@ -2934,3 +2934,4 @@
        Updated peace to 0.0.20040611 [kent 2004-06-11]
        Updated subversion to 1.0.5 [epg 2004-06-11]
        Updated milter-regex to 1.5 [jdarrow 2004-06-11]
+       Updated nbsed to 20040612 [minskim 2004-06-12]
diff -r 7dc68c1ac8e0 -r d9f219e4ffaa textproc/nbsed/Makefile
--- a/textproc/nbsed/Makefile   Sat Jun 12 04:45:21 2004 +0000
+++ b/textproc/nbsed/Makefile   Sat Jun 12 05:18:23 2004 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.4 2003/10/16 12:07:02 grant Exp $
+# $NetBSD: Makefile,v 1.5 2004/06/12 05:18:31 minskim Exp $
 
-DISTNAME=              nbsed-20031016
+DISTNAME=              nbsed-20040612
 CATEGORIES=            textproc pkgtools
 MASTER_SITES=          # empty
 DISTFILES=             # empty
diff -r 7dc68c1ac8e0 -r d9f219e4ffaa textproc/nbsed/files/compile.c
--- a/textproc/nbsed/files/compile.c    Sat Jun 12 04:45:21 2004 +0000
+++ b/textproc/nbsed/files/compile.c    Sat Jun 12 05:18:23 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compile.c,v 1.1.1.1 2003/08/18 17:34:55 agc Exp $      */
+/*     $NetBSD: compile.c,v 1.2 2004/06/12 05:18:31 minskim Exp $      */
 
 /*-
  * Copyright (c) 1992 Diomidis Spinellis.
@@ -47,7 +47,7 @@
 #if 0
 static char sccsid[] = "@(#)compile.c  8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: compile.c,v 1.1.1.1 2003/08/18 17:34:55 agc Exp $");
+__RCSID("$NetBSD: compile.c,v 1.2 2004/06/12 05:18:31 minskim Exp $");
 #endif
 #endif /* not lint */
 
@@ -466,6 +466,7 @@
        static char lbuf[_POSIX2_LINE_MAX + 1];
        int asize, ref, size;
        char c, *text, *op, *sp;
+       int sawesc = 0;
 
        c = *p++;                       /* Terminator character */
        if (c == '\0')
@@ -479,9 +480,29 @@
        do {
                op = sp = text + size;
                for (; *p; p++) {
-                       if (*p == '\\') {
-                               p++;
-                               if (strchr("123456789", *p) != NULL) {
+                       if (*p == '\\' || sawesc) {
+                               /*
+                                * If this is a continuation from the last
+                                * buffer, we won't have a character to
+                                * skip over.
+                                */
+                               if (sawesc)
+                                       sawesc = 0;
+                               else
+                                       p++;
+
+                               if (*p == '\0') {
+                                       /*
+                                        * This escaped character is continued
+                                        * in the next part of the line.  Note
+                                        * this fact, then cause the loop to
+                                        * exit w/ normal EOL case and reenter
+                                        * above with the new buffer.
+                                        */
+                                       sawesc = 1;
+                                       p--;
+                                       continue;
+                               } else if (strchr("123456789", *p) != NULL) {
                                        *sp++ = '\\';
                                        ref = *p - '0';
                                        if (s->re != NULL &&



Home | Main Index | Thread Index | Old Index