v31.1-roots.1 · Commit 2: [PATCH 02/17] feat(policy): preserve Roots parsing and local transaction checks
src/common/args.cpp
Before: src/common/args.cpp · After: src/common/args.cpp
File metadata
index 5c8589cf4402015993c3ef1a415ac770faed8fae..563015dc3977e35c1b240bfec96782aad781856f 100644
Download original patch · Release notes
Diff rows 1–10 of 10. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
src/common/args.cpp
CHANGED
|
@@ -111,6 +111,10 @@ std::optional<common::SettingsValue> InterpretValue(const KeyInfo& key, const st
|
|
| 111 |
error = strprintf("Negating of -%s is meaningless and therefore forbidden", key.name);
|
| 112 |
return std::nullopt;
|
| 113 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
// Double negatives like -nofoo=0 are supported (but discouraged)
|
| 115 |
if (value && !InterpretBool(*value)) {
|
| 116 |
LogWarning("Parsed potentially confusing double-negative -%s=%s", key.name, *value);
|
|
|
|
| 111 |
error = strprintf("Negating of -%s is meaningless and therefore forbidden", key.name);
|
| 112 |
return std::nullopt;
|
| 113 |
}
|
| 114 |
+
if ((flags & ArgsManager::STRICT_NEGATION) && value && !value->empty() && *value != "0" && *value != "1") {
|
| 115 |
+
error = strprintf("Invalid -no%s value: '%s' (expected empty, 0, or 1)", key.name, *value);
|
| 116 |
+
return std::nullopt;
|
| 117 |
+
}
|
| 118 |
// Double negatives like -nofoo=0 are supported (but discouraged)
|
| 119 |
if (value && !InterpretBool(*value)) {
|
| 120 |
LogWarning("Parsed potentially confusing double-negative -%s=%s", key.name, *value);
|