Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: vm/flags.cc

Issue 9669016: - Support "no_" as well as "no-" prefix on boolean flags. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/flags.cc
===================================================================
--- vm/flags.cc (revision 5269)
+++ vm/flags.cc (working copy)
@@ -172,11 +172,16 @@
if (*equals != '=') {
// No explicit option argument. Determine if there is a "no_" prefix
// preceding the name.
- const char* kNoPrefix = "no_";
- const intptr_t kNoPrefixLen = strlen(kNoPrefix);
- if (strncmp(option, kNoPrefix, kNoPrefixLen) == 0) {
- option += kNoPrefixLen; // Skip the "no_" when looking up the name.
+ const char* kNo1Prefix = "no_";
+ const char* kNo2Prefix = "no-";
+ const intptr_t kNo1PrefixLen = strlen(kNo1Prefix);
+ const intptr_t kNo2PrefixLen = strlen(kNo2Prefix);
+ if (strncmp(option, kNo1Prefix, kNo1PrefixLen) == 0) {
+ option += kNo1PrefixLen; // Skip the "no_" when looking up the name.
argument = "false";
+ } else if (strncmp(option, kNo2Prefix, kNo2PrefixLen) == 0) {
+ option += kNo2PrefixLen; // Skip the "no-" when looking up the name.
+ argument = "false";
} else {
argument = "true";
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698