Commit aa2d0f7b authored by Andreas Schuh's avatar Andreas Schuh

fix: Remove obsolete and unused CleanFileName code

parent 4663c80d
...@@ -580,26 +580,14 @@ CommandLineFlag::~CommandLineFlag() { ...@@ -580,26 +580,14 @@ CommandLineFlag::~CommandLineFlag() {
} }
const char* CommandLineFlag::CleanFileName() const { const char* CommandLineFlag::CleanFileName() const {
// Compute top-level directory & file that this appears in // This function has been used to strip off a common prefix from
// search full path backwards. // flag source file names. Because flags can be defined in different
// Stop going backwards at kRootDir; and skip by the first slash. // shared libraries, there may not be a single common prefix.
static const char kRootDir[] = ""; // can set this to root directory, // Further, this functionality hasn't been active for many years.
// Need a better way to produce more user friendly help output or
if (sizeof(kRootDir)-1 == 0) // no prefix to strip // "anonymize" file paths in help output, respectively.
return filename(); // Follow issue at: https://github.com/gflags/gflags/issues/86
return filename();
const char* clean_name = filename() + strlen(filename()) - 1;
while ( clean_name > filename() ) {
if (*clean_name == PATH_SEPARATOR) {
if (sizeof(kRootDir) > 1 && strncmp(clean_name, kRootDir, sizeof(kRootDir)-1) == 0) {
clean_name += sizeof(kRootDir)-1; // past root-dir
break;
}
}
--clean_name;
}
while ( *clean_name == PATH_SEPARATOR ) ++clean_name; // Skip any slashes
return clean_name;
} }
void CommandLineFlag::FillCommandLineFlagInfo( void CommandLineFlag::FillCommandLineFlagInfo(
......
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