Module Name:    src
Committed By:   riz
Date:           Fri Jan  7 01:53:33 UTC 2011

Modified Files:
        src/etc [netbsd-5]: rc.subr
        src/etc/rc.d [netbsd-5]: network
        src/share/man/man5 [netbsd-5]: ifconfig.if.5
        src/share/man/man8 [netbsd-5]: rc.subr.8

Log Message:
Pull up following revision(s) (requested by enami in ticket #1504):
        share/man/man8/rc.subr.8: revision 1.27
        etc/rc.subr: revision 1.86
        share/man/man5/ifconfig.if.5: revision 1.14
        etc/rc.d/network: revision 1.61
Add a collapse_backslash_newline function to rc.subr.
Collapse <abckslash><newline> sequences in /etc/ifconfig.xxx files read
by /etc/rc.d/network.  Fixes PR 41662 by Christoph Badura, which was
also reported independently by Jeremy C. Reed.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.73.2.1 src/etc/rc.subr
cvs rdiff -u -r1.57.2.1 -r1.57.2.2 src/etc/rc.d/network
cvs rdiff -u -r1.11.2.2 -r1.11.2.3 src/share/man/man5/ifconfig.if.5
cvs rdiff -u -r1.21 -r1.21.2.1 src/share/man/man8/rc.subr.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/rc.subr
diff -u src/etc/rc.subr:1.73 src/etc/rc.subr:1.73.2.1
--- src/etc/rc.subr:1.73	Mon Jun 23 03:26:18 2008
+++ src/etc/rc.subr	Fri Jan  7 01:53:32 2011
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.73 2008/06/23 03:26:18 dholland Exp $
+# $NetBSD: rc.subr,v 1.73.2.1 2011/01/07 01:53:32 riz Exp $
 #
 # Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -911,4 +911,26 @@
 	fi
 }
 
+#
+# collapse_backslash_newline
+#	Copy input to output, collapsing <backslash><newline>
+#	to nothing, but leaving other backslashes alone.
+#
+collapse_backslash_newline()
+{
+	local line
+	while read -r line ; do
+		case "$line" in
+		*\\)
+			# print it, without the backslash or newline
+			printf "%s" "${line%?}"
+			;;
+		*)
+			# print it, with a newline
+			printf "%s\n" "${line}"
+			;;
+		esac
+	done
+}
+
 _rc_subr_loaded=:

Index: src/etc/rc.d/network
diff -u src/etc/rc.d/network:1.57.2.1 src/etc/rc.d/network:1.57.2.2
--- src/etc/rc.d/network:1.57.2.1	Mon May 18 19:30:48 2009
+++ src/etc/rc.d/network	Fri Jan  7 01:53:33 2011
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: network,v 1.57.2.1 2009/05/18 19:30:48 bouyer Exp $
+# $NetBSD: network,v 1.57.2.2 2011/01/07 01:53:33 riz Exp $
 #
 
 # PROVIDE: network
@@ -259,6 +259,7 @@
 				)
 				;;
 			esac |
+			collapse_backslash_newline |
 			while read -r args; do
 				case "$args" in
 				''|"#"*|create)

Index: src/share/man/man5/ifconfig.if.5
diff -u src/share/man/man5/ifconfig.if.5:1.11.2.2 src/share/man/man5/ifconfig.if.5:1.11.2.3
--- src/share/man/man5/ifconfig.if.5:1.11.2.2	Thu Jan 22 19:53:44 2009
+++ src/share/man/man5/ifconfig.if.5	Fri Jan  7 01:53:32 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ifconfig.if.5,v 1.11.2.2 2009/01/22 19:53:44 snj Exp $
+.\"	$NetBSD: ifconfig.if.5,v 1.11.2.3 2011/01/07 01:53:32 riz Exp $
 .\"
 .\" Copyright (c) 1996 Matthew R. Green
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd January 9, 2009
+.Dd September 26, 2010
 .Dt IFCONFIG.IF 5
 .Os
 .Sh NAME
@@ -63,6 +63,9 @@
 In the case of a variable, semicolons may be used instead of
 newlines, as described in
 .Xr rc.conf 5 .
+.Ao backslash Ac Ns Ao newline Ac
+sequences in files are ignored, so long logical lines may be
+made up of several shorter physical lines.
 .Pp
 Normally, a line will be evaluated as command line arguments to
 .Xr ifconfig 8 .

Index: src/share/man/man8/rc.subr.8
diff -u src/share/man/man8/rc.subr.8:1.21 src/share/man/man8/rc.subr.8:1.21.2.1
--- src/share/man/man8/rc.subr.8:1.21	Sun May 25 09:07:21 2008
+++ src/share/man/man8/rc.subr.8	Fri Jan  7 01:53:32 2011
@@ -1,4 +1,4 @@
-.\" 	$NetBSD: rc.subr.8,v 1.21 2008/05/25 09:07:21 wiz Exp $
+.\" 	$NetBSD: rc.subr.8,v 1.21.2.1 2011/01/07 01:53:32 riz Exp $
 .\"
 .\" Copyright (c) 2002-2004 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -46,6 +46,8 @@
 .It
 .Ic check_process Ar procname Op Ar interpreter
 .It
+.Ic collapse_backslash_newline
+.It
 .Ic err Ar exitval Ar message
 .It
 .Ic load_rc_config Ar command
@@ -205,6 +207,10 @@
 .Ar interpreter
 is handled as per
 .Ic check_pidfile .
+.It Ic collapse_backslash_newline
+Copy input to output, collapsing
+.Ao backslash Ac Ns Ao newline Ac
+to nothing, but leaving other backslashes alone.
 .It Ic err Ar exitval Ar message
 Display an error message to
 .Em stderr ,

Reply via email to