Module Name:    src
Committed By:   dholland
Date:           Thu Jan  6 08:18:43 UTC 2011

Modified Files:
        src/usr.bin/find: function.c

Log Message:
Fix "-exec blah blah {} +" so it only matches when the {} is last, as
per the standard. Per (brief) discussion on tech-userlevel.

There should really be a form where you can do the equivalent of
"-exec blah {} blah +", but I think we're going to need to call it
something other than -exec. As it is it's sort of surprising that the
standards people didn't add a different name -- note what happens if
you try to do something like "find ... -exec expr {} + 2 \;".


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/find/function.c

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

Modified files:

Index: src/usr.bin/find/function.c
diff -u src/usr.bin/find/function.c:1.64 src/usr.bin/find/function.c:1.65
--- src/usr.bin/find/function.c:1.64	Thu Jul 19 07:49:30 2007
+++ src/usr.bin/find/function.c	Thu Jan  6 08:18:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: function.c,v 1.64 2007/07/19 07:49:30 daniel Exp $	*/
+/*	$NetBSD: function.c,v 1.65 2011/01/06 08:18:42 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "from: @(#)function.c	8.10 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: function.c,v 1.64 2007/07/19 07:49:30 daniel Exp $");
+__RCSID("$NetBSD: function.c,v 1.65 2011/01/06 08:18:42 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -646,6 +646,7 @@
 			errx(1, "%s: no terminating \";\" or \"+\"",
 			    isok ? "-ok" : "-exec");
 		lastbrace = brace;
+		brace = 0;
 		if (strcmp(*ap, "{}") == 0)
 			brace = 1;
 		if (strcmp(*ap, ";") == 0)

Reply via email to