Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
G
gflags
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
gflags
Commits
aa2d0f7b
Commit
aa2d0f7b
authored
Jul 11, 2017
by
Andreas Schuh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Remove obsolete and unused CleanFileName code
parent
4663c80d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
20 deletions
+8
-20
gflags.cc
src/gflags.cc
+8
-20
No files found.
src/gflags.cc
View file @
aa2d0f7b
...
...
@@ -580,26 +580,14 @@ CommandLineFlag::~CommandLineFlag() {
}
const
char
*
CommandLineFlag
::
CleanFileName
()
const
{
// Compute top-level directory & file that this appears in
// search full path backwards.
// Stop going backwards at kRootDir; and skip by the first slash.
static
const
char
kRootDir
[]
=
""
;
// can set this to root directory,
if
(
sizeof
(
kRootDir
)
-
1
==
0
)
// no prefix to strip
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
;
// This function has been used to strip off a common prefix from
// flag source file names. Because flags can be defined in different
// shared libraries, there may not be a single common prefix.
// Further, this functionality hasn't been active for many years.
// Need a better way to produce more user friendly help output or
// "anonymize" file paths in help output, respectively.
// Follow issue at: https://github.com/gflags/gflags/issues/86
return
filename
();
}
void
CommandLineFlag
::
FillCommandLineFlagInfo
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment