Module Name:    src
Committed By:   apb
Date:           Mon Sep 14 22:30:30 UTC 2009

Modified Files:
        src/etc: rc.subr

Log Message:
Fix some errors in the way scripts with "KEYWORD: interactive"
are handled.  There was an inverted test, and "set $_args"
had the wrong scope (in several nearly-identical blocks of code).


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/etc/rc.subr

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.79 src/etc/rc.subr:1.80
--- src/etc/rc.subr:1.79	Mon Sep 14 12:05:12 2009
+++ src/etc/rc.subr	Mon Sep 14 22:30:30 2009
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.79 2009/09/14 12:05:12 apb Exp $
+# $NetBSD: rc.subr,v 1.80 2009/09/14 22:30:30 apb Exp $
 #
 # Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -802,7 +802,7 @@
 	eval unset ${_arg}_cmd ${_arg}_precmd ${_arg}_postcmd
 
 	_must_redirect=false
-	if ! [ -n "${_rc_postprocessor_fd}" ] \
+	if [ -n "${_rc_postprocessor_fd}" ] \
 	    && _has_rcorder_keyword interactive $_file
 	then
 		_must_redirect=true
@@ -813,7 +813,8 @@
 		if $_must_redirect; then
 			print_rc_metadata \
 			    "note:Output from ${_file} is not logged"
-			set $_arg ; no_rc_postprocess . $_file
+			no_rc_postprocess eval \
+			    'set $_arg ; . $_file'
 		else
 			set $_arg ; . $_file
 		fi
@@ -826,9 +827,11 @@
 			print_rc_metadata \
 			    "note:Output from ${_file} is not logged"
 			if [ -n "$rc_fast_and_loose" ]; then
-				set $_arg ; no_rc_postprocess . $_file
+				no_rc_postprocess eval \
+				    'set $_arg ; . $_file'
 			else
-				( set $_arg ; no_rc_postprocess . $_file )
+				no_rc_postprocess eval \
+				    '( set $_arg ; . $_file )'
 			fi
 		elif [ -x $_file ]; then
 			if [ -n "$rc_fast_and_loose" ]; then

Reply via email to