[darwinbuild-changes] [836] branches/PR-7872907/darwinup/Depot.cpp

source_changes at macosforge.org source_changes at macosforge.org
Thu Jun 10 11:13:25 PDT 2010


Revision: 836
          http://trac.macosforge.org/projects/darwinbuild/changeset/836
Author:   wsiegrist at apple.com
Date:     2010-06-10 11:13:21 -0700 (Thu, 10 Jun 2010)
Log Message:
-----------
Match "all" and "superseded" exactly.

Modified Paths:
--------------
    branches/PR-7872907/darwinup/Depot.cpp

Modified: branches/PR-7872907/darwinup/Depot.cpp
===================================================================
--- branches/PR-7872907/darwinup/Depot.cpp	2010-06-10 17:46:38 UTC (rev 835)
+++ branches/PR-7872907/darwinup/Depot.cpp	2010-06-10 18:13:21 UTC (rev 836)
@@ -1076,9 +1076,9 @@
 		archive = NULL;
 		archcnt = 0;
 		// check for special keywords
-		if (strncasecmp(args[i], "all", 3) == 0) {
+		if (strncasecmp(args[i], "all", 3) == 0 && strlen(args[i]) == 3) {
 			list = this->get_all_archives(&archcnt);
-		} else if (strncasecmp(args[i], "superseded", 10) == 0) {
+		} else if (strncasecmp(args[i], "superseded", 10) == 0 && strlen(args[i]) == 10) {
 			list = this->get_superseded_archives(&archcnt);
 		} 
 		if (archcnt) {
@@ -1377,9 +1377,9 @@
 	uint32_t count = 0;
 	Archive** list = NULL;
 	
-	if (strncasecmp(archspec, "all", 3) == 0) {
+	if (strncasecmp(archspec, "all", 3) == 0 && strlen(archspec) == 3) {
 		list = this->get_all_archives(&count);
-	} else if (strncasecmp(archspec, "superseded", 10) == 0) {
+	} else if (strncasecmp(archspec, "superseded", 10) == 0 && strlen(archspec) == 10) {
 		list = this->get_superseded_archives(&count);
 	} else {
 		// make a list of 1 Archive
@@ -1409,8 +1409,8 @@
 	extern uint32_t verbosity;
 	int res = 0;
 	
-	if (strncasecmp(archspec, "all", 3) == 0 ||
-		strncasecmp(archspec, "superseded", 10) == 0) {
+	if ((strncasecmp(archspec, "all", 3) == 0 && strlen(archspec) == 3) ||
+		(strncasecmp(archspec, "superseded", 10) == 0 && strlen(archspec) == 10)) {
 		fprintf(stderr, "Error: keywords 'all' and 'superseded' cannot be used with the"
 				" rename command.\n");
 		return -2;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20100610/16c36361/attachment.html>


More information about the darwinbuild-changes mailing list