Module Name:    src
Committed By:   dsl
Date:           Sat Oct 31 14:30:55 UTC 2009

Modified Files:
        src/dist/nvi/ex: ex_write.c

Log Message:
Save command in :w !<command> for later :w !!
Fixes PR/8169


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/dist/nvi/ex/ex_write.c

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

Modified files:

Index: src/dist/nvi/ex/ex_write.c
diff -u src/dist/nvi/ex/ex_write.c:1.2 src/dist/nvi/ex/ex_write.c:1.3
--- src/dist/nvi/ex/ex_write.c:1.2	Fri Dec  5 22:51:42 2008
+++ src/dist/nvi/ex/ex_write.c	Sat Oct 31 14:30:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ex_write.c,v 1.2 2008/12/05 22:51:42 christos Exp $ */
+/*	$NetBSD: ex_write.c,v 1.3 2009/10/31 14:30:55 dsl Exp $ */
 
 /*-
  * Copyright (c) 1992, 1993, 1994
@@ -134,6 +134,7 @@
 	size_t nlen;
 	const char *n;
 	int rc;
+	EX_PRIVATE *exp;
 
 	NEEDFILE(sp, cmdp);
 
@@ -163,6 +164,12 @@
 		if (argv_exp1(sp, cmdp, p, STRLEN(p), 1))
 			return (1);
 
+		/* Set the last bang command */
+		exp = EXP(sp);
+		free(exp->lastbcomm);
+		exp->lastbcomm = v_wstrdup(sp, cmdp->argv[1]->bp,
+		    cmdp->argv[1]->len);
+
 		/*
 		 * Historically, vi waited after a write filter even if there
 		 * wasn't any output from the command.  People complained when

Reply via email to