File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 2828
2929typedef struct {
3030 int error_unmatch ;
31- char * files [1024 ];
31+ char * files [1024 ];
3232 size_t file_count ;
3333} ls_options ;
3434
@@ -84,13 +84,13 @@ static int print_paths(ls_options *opts, git_index *index)
8484 size_t i ;
8585 const git_index_entry * entry ;
8686
87- /* if there are not files explicitly listed by the user print all entries in the index */
87+ /* if there are no files explicitly listed by the user print all entries in the index */
8888 if (opts -> file_count == 0 ) {
8989 size_t entry_count = git_index_entrycount (index );
9090
9191 for (i = 0 ; i < entry_count ; i ++ ) {
9292 entry = git_index_get_byindex (index , i );
93- printf ( "%s\n" , entry -> path );
93+ puts ( entry -> path );
9494 }
9595 return 0 ;
9696 }
@@ -100,7 +100,7 @@ static int print_paths(ls_options *opts, git_index *index)
100100 const char * path = opts -> files [i ];
101101
102102 if ((entry = git_index_get_bypath (index , path , GIT_INDEX_STAGE_NORMAL )) != NULL ) {
103- printf ( "%s\n" , path );
103+ puts ( path );
104104 } else if (opts -> error_unmatch ) {
105105 fprintf (stderr , "error: pathspec '%s' did not match any file(s) known to git.\n" , path );
106106 fprintf (stderr , "Did you forget to 'git add'?\n" );
You can’t perform that action at this time.
0 commit comments