Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
d2f99e0a
Commit
d2f99e0a
authored
Oct 22, 2017
by
Carson Howard
Committed by
Carson Howard
Mar 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples: ls-files: fix compile error
parent
cd39273d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
examples/ls-files.c
+7
-3
No files found.
examples/ls-files.c
View file @
d2f99e0a
...
...
@@ -49,7 +49,7 @@ static void usage(const char *message, const char *arg)
exit
(
1
);
}
static
void
parse_options
(
ls_options
*
opts
,
int
argc
,
char
*
argv
[])
static
int
parse_options
(
ls_options
*
opts
,
int
argc
,
char
*
argv
[])
{
int
parsing_files
=
0
;
struct
args_info
args
=
ARGS_INFO_INIT
;
...
...
@@ -58,7 +58,7 @@ static void parse_options(ls_options *opts, int argc, char *argv[])
memset
(
opts
,
0
,
sizeof
(
ls_options
));
if
(
argc
<
2
)
return
;
return
0
;
for
(
args
.
pos
=
1
;
args
.
pos
<
argc
;
++
args
.
pos
)
{
char
*
a
=
argv
[
args
.
pos
];
...
...
@@ -77,8 +77,11 @@ static void parse_options(ls_options *opts, int argc, char *argv[])
opts
->
error_unmatch
=
1
;
}
else
{
usage
(
"Unsupported argument"
,
a
);
return
-
1
;
}
}
return
0
;
}
static
int
print_paths
(
ls_options
*
opts
,
git_index
*
index
)
...
...
@@ -113,7 +116,8 @@ int main(int argc, char *argv[])
size_t
i
=
0
;
int
error
;
parse_options
(
&
opts
,
argc
,
argv
);
if
((
error
=
parse_options
(
&
opts
,
argc
,
argv
))
<
0
)
return
error
;
git_libgit2_init
();
...
...
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