Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
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
protobuf
Commits
bc813c37
Commit
bc813c37
authored
Jul 15, 2019
by
Laszlo Csomor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address reviewer comments.
parent
a118acc4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
10 deletions
+6
-10
command_line_interface.cc
src/google/protobuf/compiler/command_line_interface.cc
+3
-3
io_win32.cc
src/google/protobuf/io/io_win32.cc
+1
-1
io_win32.h
src/google/protobuf/io/io_win32.h
+2
-6
No files found.
src/google/protobuf/compiler/command_line_interface.cc
View file @
bc813c37
...
...
@@ -1432,14 +1432,14 @@ CommandLineInterface::InterpretArgument(const std::string& name,
#if defined(_WIN32)
// On Windows, the shell (typically cmd.exe) does not expand wildcards in
// file names (e.g. foo\*.proto), so we do it ourselves.
switch
(
google
::
protobuf
::
i
nternal
::
win32
::
expand_wildcards
(
switch
(
google
::
protobuf
::
i
o
::
win32
::
expand_wildcards
(
value
,
[
this
](
const
string
&
path
)
{
this
->
input_files_
.
push_back
(
path
);
}))
{
case
google
:
:
protobuf
::
i
nternal
::
win32
::
ExpandWildcardsResult
::
kSuccess
:
case
google
:
:
protobuf
::
i
o
::
win32
::
ExpandWildcardsResult
::
kSuccess
:
break
;
case
google
:
:
protobuf
::
i
nternal
::
win32
::
ExpandWildcardsResult
::
kErrorNoMatchingFile
:
case
google
:
:
protobuf
::
i
o
::
win32
::
ExpandWildcardsResult
::
kErrorNoMatchingFile
:
// Path does not exist, is not a file, or it's longer than MAX_PATH and
// long path handling is disabled.
std
::
cerr
<<
"Invalid file name pattern or missing input file
\"
"
...
...
src/google/protobuf/io/io_win32.cc
View file @
bc813c37
...
...
@@ -362,7 +362,7 @@ wstring testonly_utf8_to_winpath(const char* path) {
return
as_windows_path
(
path
,
&
wpath
)
?
wpath
:
wstring
();
}
bool
expand_wildcards
(
int
expand_wildcards
(
const
string
&
path
,
std
::
function
<
void
(
const
string
&
)
>
consume
)
{
if
(
path
.
find_first_of
(
"*?"
)
==
string
::
npos
)
{
// There are no wildcards in the path, we don't need to expand it.
...
...
src/google/protobuf/io/io_win32.h
View file @
bc813c37
...
...
@@ -92,12 +92,8 @@ struct ExpandWildcardsResult {
// in the last path segment. This function passes all matching file names to
// `consume`. The resulting paths may not be absolute nor normalized.
//
// The function returns true if the path did not contain any wildcards (in
// which case the path may or may not exist), or the path did contain wildcards
// and it matched at least one file.
// The function returns false if the path contained wildcards but it did not
// match any files.
LIBPROTOBUF_EXPORT
bool
expand_wildcards
(
// The function returns a value from `ExpandWildcardsResult`.
LIBPROTOBUF_EXPORT
int
expand_wildcards
(
const
std
::
string
&
path
,
std
::
function
<
void
(
const
std
::
string
&
)
>
consume
);
namespace
strings
{
...
...
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