Commit 7e709881 authored by Andreas Schuh's avatar Andreas Schuh Committed by Andreas Schuh

fix: PVS Studio warnings

parent 754d3329
......@@ -1036,16 +1036,15 @@ uint32 CommandLineFlagParser::ParseNewCommandLineFlags(int* argc, char*** argv,
char* arg = (*argv)[i];
// Like getopt(), we permute non-option flags to be at the end.
if (arg[0] != '-' || arg[1] == '\0') { // must be a program argument "-" is an argument, not a flag
if (arg[0] != '-' || arg[1] == '\0') { // must be a program argument: "-" is an argument, not a flag
memmove((*argv) + i, (*argv) + i+1, (*argc - (i+1)) * sizeof((*argv)[i]));
(*argv)[*argc-1] = arg; // we go last
first_nonopt--; // we've been pushed onto the stack
i--; // to undo the i++ in the loop
continue;
}
if (arg[0] == '-') arg++; // allow leading '-'
if (arg[0] == '-') arg++; // or leading '--'
arg++; // skip leading '-'
if (arg[0] == '-') arg++; // or leading '--'
// -- alone means what it does for GNU: stop options parsing
if (*arg == '\0') {
......
......@@ -550,8 +550,7 @@ static void FinalizeCompletionOutput(
vector<DisplayInfoGroup> output_groups;
bool perfect_match_found = false;
if (lines_so_far < max_desired_lines &&
!notable_flags->perfect_match_flag.empty()) {
if (!notable_flags->perfect_match_flag.empty()) {
perfect_match_found = true;
DisplayInfoGroup group =
{ "",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment